(event->callback-pred callback-pred)
Looks at the required-events items and returns a predicate which will either
Looks at the required-events items and returns a predicate which will either - match only the event-keyword if a keyword is supplied - match the entire event vector if a collection is supplied - returns a callback-pred if it is a fn
(make-rules-event-handler {:keys [id rules first-dispatch first-dispatch-n]
:as m})
Given a flow definition, returns an event handler which implements this definition
Given a flow definition, returns an event handler which implements this definition
(massage-rule flow-id
index
{:keys [id when events dispatch dispatch-n dispatch-fn unbind?]
:as rule})
(massage-rules flow-id rules)
Massage the supplied rules as follows:
:when
keyword value with a function implementing the predicate:dispatch
or :dispatch-n
is providedMassage the supplied rules as follows: - replace `:when` keyword value with a function implementing the predicate - ensure that only `:dispatch` or `:dispatch-n` is provided - add a unique :id, if one not already present
(process-event {:as m
:keys [:com.jeaye.re-frame-rules/unregister
:com.jeaye.re-frame-rules/register
:com.jeaye.re-frame-rules/events
:com.jeaye.re-frame-rules/dispatch-to]})
(rules->dispatches rules event)
Given an rule and event, return a sequence of dispatches. For each dispatch in the rule:
Given an rule and event, return a sequence of dispatches. For each dispatch in the rule: - if the dispatch is a keyword, return it as is - if the dispatch is a function, call the function with the event
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close