Liking cljdoc? Tell your friends :D

ribelo.praxis


-add-node!clj/s

(-add-node! id x)
(-add-node! id deps f)

[pure] adds a node to the graph, prefer using defnode

id should be a unique keyword, preferably namespaced

deps should be a collection of id referring to other nodes

f should by should be a function that takes as first paramter an id, second an map with resolved deps, the optional third argument can be anything, if you need to pass more variables use a map

[pure] adds a node to the graph, prefer using [[defnode]]


`id` should be a unique `keyword`, preferably namespaced

`deps` should be a collection of `id` referring to other nodes

`f` should by should be a function that takes as first paramter an `id`, second
an map with resolved deps, the optional third argument can be anything, if
you need to pass more variables use a map
sourceraw docstring

-add-watch!clj/s

create event stream watcher. argument should be an Event record.

in fact adds the Event to the event stream as soon as the graph is built, but cache ensures that each event is only added to the stream once

create `event stream` watcher. argument should be an [[Event]] record.


in fact adds the [[Event]] to the `event stream` as soon as the
`graph` is built, but cache ensures that each event is only added to the
stream once
sourceraw docstring

-debounceclj/s

(-debounce >f)
source

-emitclj/s

(-emit e & more)
source

-kw-identical?clj/s

(-kw-identical? x y)
source

-listenclj/s

(-listen >flow f)

[pure] creates a listener for the Node of the dag, every time the value of a Node changes the function is called.

function f should take two arguments, the first is the listener id, the second is the Node value. returns a function that allows to delete a listener

use as event

(emit ::listen! id f)
[pure] creates a `listener` for the [[Node]] of the `dag`, every time the
value of a [[Node]] changes the function is called.


function `f` should take two arguments, the first is the listener `id`, the
second is the [[Node]] value. returns a function that allows to delete a
`listener`


use as event
```clojure
(emit ::listen! id f)
```
sourceraw docstring

-memoizeclj/s

(-memoize f)
(-memoize ttl-ms f)

faster than [[clojure.core/memoize]], but f can takes only one argument and support ttl

faster than [[clojure.core/memoize]], but `f` can takes only one argument and
support `ttl`
sourceraw docstring

-now-udtclj/s

(-now-udt)
source

-sentinelclj/s

source

-watchable?clj/s

(-watchable? x)

checks if x supports add-watch

checks if `x` supports `add-watch`
sourceraw docstring

CacheEntrycljs

source

dagclj/s≠

clj

the whole body of the graph. it is a proxy for the private nodes_ atom to make sure we don't hurt ourselves by directly manipulating it

the whole body of the `graph`. it is a proxy for the private nodes_ atom to
make sure we don't hurt ourselves by directly manipulating it
source (clj)source (cljs)raw docstring

defeffectclj/smacro

(defeffect id & args)

like defevent creates an event method.

like [[defevent]] creates an [[event]] method.
sourceraw docstring

defeventclj/smacro

(defevent id & args)

declares an event method.

the macro underneath creates an event method for the id returning a Event record.

supports ::silent and ::in-reactor-context metadata.

declares an [[event]] method.


the macro underneath creates an [[event]] method for the `id` returning a
[[Event]] record.

supports `::silent` and `::in-reactor-context` metadata.
sourceraw docstring

defnodeclj/smacro

(defnode id & args)

defines the computational graph Node.

Node can be a single static value, a variable that supports add-watch, or a function

function Node may have dependencies on other nodes. calculations are incremental and a Node is recalculated only when dependencies change.

see also -add-node!

defines the computational graph [[Node]].


[[Node]] can be a single static value, a variable that supports `add-watch`,
or a `function`


`function` [[Node]] may have dependencies on other `nodes`. calculations are
incremental and a [[Node]] is recalculated only when dependencies change.


see also [[-add-node!]]
sourceraw docstring

defstreamclj/smacro

(defstream id & args)

like defevent creates an event method.

like [[defevent]] creates an [[event]] method.
sourceraw docstring

dispose!clj/s

(dispose!)

[inpure] dispose reactor

[inpure] dispose reactor
sourceraw docstring

emitclj/s

(emit e & args)

[pure] add an event or a sequence of events to the event stream. the event can be either a Event record, or a keyword identifying an event method.

returns the value returned by the event or stream

[pure] add an [[event]] or a sequence of events to the `event stream`. the
[[event]] can be either a [[Event]] record, or a `keyword` identifying an
[[event]] `method`.

returns the value returned by the event or `stream`
sourceraw docstring

emit!clj/s

(emit! e & args)

calls the emit and immediately execute the returned task.

returns dataflow containing the result of the reduction.

calls the [[emit]] and immediately execute the returned `task`. 

returns `dataflow` containing the result of the reduction.
sourceraw docstring

emit>clj/s

(emit> e & args)

calls the emit and immediately reduce the returned flow.

returns dataflow containing the result of the reduction.

calls the [[emit]] and immediately `reduce` the returned `flow`.

returns `dataflow` containing the result of the reduction.
sourceraw docstring

Eventclj/s

source

eventclj/smultimethod

declare an event, should return a Event reocrd. for flexibility supports up to four arguments, if you need more you should really consider using a map.

declare an event, should return a [[Event]] reocrd. for flexibility supports
up to four arguments, if you need more you should really consider using a map.
sourceraw docstring

event?clj/s

(event? e)
(event? id e)

checks if e is instance of Event record, when id is also given, checks furthermore if the [[event-id]] is identical to the id.

can be used to filter SilentEvent from the event stream

checks if `e` is instance of [[Event]] record, when `id` is also given,
checks furthermore if the [[event-id]] is identical to the `id`.


can be used to filter SilentEvent from the `event stream`
sourceraw docstring

handle-errorclj/smultimethod

allows automatic handling of errors arising as a result of Event function calls

a more functional approach to error handling.

allows automatic handling of errors arising as a result of [[Event]]
function calls


a more functional approach to error handling. 
sourceraw docstring

Listenercljs

source

nodeclj/s

source

reset-graph-inputs!clj/s

(reset-graph-inputs! m)

resets the atoms holding the values of the static nodes of the dag

resets the atoms holding the values of the static nodes of the dag
sourceraw docstring

run!clj/s

(run!)

[inpure] starts the missionary.core/reactor

[inpure] starts the `missionary.core/reactor`
sourceraw docstring

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

× close