Liking cljdoc? Tell your friends :D

xframe.core.alpha

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)

  4. Initial Adapton graph + subscriptions in UI db +---> A +---> B +---> [B]

+---> C +---> D

  1. db is updated, calling subscription listener [B] db +====> A +====> B +====> [B]

+---> 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
raw docstring

-reg-subclj/s

(-reg-sub name f)

<-clj/s

(<- s)
(<- [name & args] key)

<subclj/smacro

(<sub s)

dbclj/s


dispatchclj/s

(dispatch [name :as event])

event-handlersclj/s


fx-handlersclj/s


memoize-last-byclj/s

(memoize-last-by key-f args-f f)

notify-listeners!clj/s

(notify-listeners!)

reg-db-subclj/s

(reg-db-sub)

reg-event-dbclj/s

(reg-event-db name f)

reg-event-fxclj/s

(reg-event-fx name f)

reg-fxclj/s

(reg-fx name f)

reg-subclj/smacro

(reg-sub name [_ args & body])

reset-dbcljs

(reset-db)

subs-graphclj/s

(subs-graph a)

Takes db and returns its dependency graph

Takes db and returns its dependency graph
raw docstring

subscribe-refclj/s

(subscribe-ref get-state)

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close