Liking cljdoc? Tell your friends :D

com.jeaye.re-frame-rules


event->callback-predcljs

(event->callback-pred callback-pred)

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
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
sourceraw docstring

get-dispatch-ncljs

(get-dispatch-n dispatch dispatch-n)
source

make-rules-event-handlercljs

(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
sourceraw docstring

map-when->fncljs

source

massage-rulecljs

(massage-rule flow-id
              index
              {:keys [id when events dispatch dispatch-n dispatch-fn unbind?]
               :as rule})
source

massage-rulescljs

(massage-rules flow-id rules)

Massage 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
Massage 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
sourceraw docstring

match-rulescljs

(match-rules rules seen-event)
source

process-eventcljs

(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]})
source

rules->dispatchescljs

(rules->dispatches rules event)

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
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
sourceraw docstring

seen-any?cljs

(seen-any? required-events seen-event)
source

when->fncljs

(when->fn when-kw)
source

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

× close