mirror of
https://github.com/penpot/penpot.git
synced 2026-05-14 20:43:55 +00:00
22 lines
652 B
Clojure
22 lines
652 B
Clojure
(ns uxbox.ui.core
|
|
(:require [beicon.core :as rx]))
|
|
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
;; Actions
|
|
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
|
|
(defonce actions-lock (atom :nothing))
|
|
(defonce actions-s (rx/bus))
|
|
|
|
(defn acquire-action!
|
|
[type]
|
|
(when-let [result (compare-and-set! actions-lock :nothing type)]
|
|
;; (println "acquire-action!" type)
|
|
(rx/push! actions-s type)))
|
|
|
|
(defn release-action!
|
|
[type]
|
|
(when-let [result (compare-and-set! actions-lock type :nothing)]
|
|
;; (println "release-action!" type)
|
|
(rx/push! actions-s :nothing)))
|