Liking cljdoc? Tell your friends :D

org.martinklepsch.derivatives


*derivatives*clj/s

source

buildclj/s

(build spec)

Given a spec return a map of similar structure replacing it's values with derived atoms built based on the depedency information encoded in the spec

WARNING: This will create derived atoms for all keys so it may lead to some uneccesary computations To avoid this issue consider using derivatives-pool which manages derivatives in a registry removing them as soon as they become unused

Given a spec return a map of similar structure replacing it's values with
derived atoms built based on the depedency information encoded in the spec

WARNING: This will create derived atoms for all keys so it may lead
to some uneccesary computations To avoid this issue consider using
`derivatives-pool` which manages derivatives in a registry
removing them as soon as they become unused
sourceraw docstring

calc-depsclj/s

(calc-deps graph ks)

Calculate all dependencies for ks and return a set with the dependencies and ks

Calculate all dependencies for `ks` and return a set with the dependencies and `ks`
sourceraw docstring

depend'clj/s

(depend' graph node deps)

Variation of depend that takes a list of dependencies instead of one

Variation of `depend` that takes a list of dependencies instead of one
sourceraw docstring

derivatives-poolclj/s

(derivatives-pool spec)

Given a derivatives spec return a map with get! and free! functions.

  • (get! derivative-id token) will retrieve a derivative for derivative-id registering the usage with token
  • (free! derivative-id token) will indicate the derivative derivative-id is no longer needed by token, if there are no more tokens needing the derivative it will be removed
Given a derivatives spec return a map with `get!` and `free!` functions.

- (get! derivative-id token) will retrieve a derivative for
  `derivative-id` registering the usage with `token`
- (free! derivative-id token) will indicate the derivative `derivative-id`
  is no longer needed by `token`, if there are no more tokens needing
  the derivative it will be removed
sourceraw docstring

DerivativesPoolcljs

source

drvclj/s

(drv & drv-ks)

Rum mixin to retrieve derivatives for drv-ks using the functions in the component context To get the derived-atom use get-ref for swappable client/server behavior

Rum mixin to retrieve derivatives for `drv-ks` using the functions in the component context
To get the derived-atom use `get-ref` for swappable client/server behavior
sourceraw docstring

get-refclj/s

(get-ref state drv-k)

Get the derivative identified by drv-k from the component state. When rendering in Clojure this looks for drv-k in the dynvar *derivatives

Get the derivative identified by `drv-k` from the component state.
When rendering in Clojure this looks for `drv-k` in the dynvar `*derivatives`
sourceraw docstring

IDerivativesPoolclj/s≠protocol

release!clj/s

(release! this drv-k token)

get!clj/s

(get! this drv-k token)
source

not-requiredclj/s

(not-required drv-map required?)
source

prefix-idclj/s

(prefix-id)
source

reactclj/s

(react state drv-k)

Like get-ref wrapped in rum.core/react

Like `get-ref` wrapped in `rum.core/react`
sourceraw docstring

react-allclj/s

(react-all state & ks)

React to multiple derivatives in the components state. If any ks are passed, react to those and return their values in a map. If no ks is passed return all available derivatives deref'ed as a map.

React to multiple derivatives in the components state.
If any `ks` are passed, react to those and return their values
in a map. If no `ks` is passed return all available derivatives
deref'ed as a map.
sourceraw docstring

rum-derivativesclj/s

(rum-derivatives spec)

Given the passed spec add get!/release! derivative functions to the child context so they can be seen by components using the deriv mixin.

Given the passed spec add get!/release! derivative functions to
the child context so they can be seen by components using the `deriv`
mixin.
sourceraw docstring

rum-derivatives*clj/s

(rum-derivatives* get-spec-fn)

Like rum-derivatives but get the spec from the arguments passed to the components (:rum/args) using get-spec-fn

Like rum-derivatives but get the spec from the arguments passed to the components (`:rum/args`) using `get-spec-fn`
sourceraw docstring

spec->graphclj/s

(spec->graph spec)

Turn a given spec into a dependency graph

Turn a given spec into a dependency graph
sourceraw docstring

sync-derivatives!clj/s

(sync-derivatives! spec watch-key-prefix drv-map order)

Update the derivatives map drv-map so that all keys passed in order are statisfied and any superfluous keys are removed. Values of superfluous keys that implement IDisposable they will also be disposed.

Update the derivatives map `drv-map` so that all keys passed in `order`
are statisfied and any superfluous keys are removed.
Values of superfluous keys that implement IDisposable they will also be disposed.
sourceraw docstring

watchable?clj/s

(watchable? x)

Platform-agnostic helper to determine if something is watchable (atom, etc)

Platform-agnostic helper to determine if something is watchable (atom, etc)
sourceraw docstring

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

× close