EXPERIMENTAL: Global state management based on Adapton https://github.com/roman01la/adapton
How it works:
When UI is rendered <sub
calls register listeners on Adapton nodes (subscriptions)
When app db is updated, xFrame calls all listeners currently registered
Listeners evaluate Adapton nodes, which triggers evaluation of the graph up to the root node (app db)
Initial Adapton graph + subscriptions in UI db +---> A +---> B +---> [B]
+---> C +---> D
+---> C +---> D
Alternatives:
EXPERIMENTAL: Global state management based on Adapton https://github.com/roman01la/adapton How it works: - App db is Adapton ref node - A subscription is Adapton thunk node - Subscriptions graph is a graph of Adapton nodes maintained by Adapton itself 1. When UI is rendered `<sub` calls register listeners on Adapton nodes (subscriptions) 2. When app db is updated, xFrame calls all listeners currently registered 3. Listeners evaluate Adapton nodes, which triggers evaluation of the graph up to the root node (app db) 1. Initial Adapton graph + subscriptions in UI db +---> A +---> B +---> [B] + +---> C +---> D 2. db is updated, calling subscription listener [B] db +====> A +====> B +====> [B] + +---> C +---> D Alternatives: - https://github.com/salsa-rs/salsa
(-reg-sub name f)
(<- s)
(<- [name & args] key)
(<sub s)
(dispatch [name :as event])
(memoize-last-by key-f args-f f)
(notify-listeners!)
(reg-db-sub)
(reg-event-db name f)
(reg-event-fx name f)
(reg-fx name f)
(reg-sub name [_ args & body])
(reset-db)
(subs-graph a)
Takes db and returns its dependency graph
Takes db and returns its dependency graph
(subscribe-ref get-state)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close