Improve comments around post-event-callback stuff

This commit is contained in:
Mike Thompson 2016-07-29 14:31:31 +10:00
parent 996eda62ce
commit 7fff9c6039
1 changed files with 11 additions and 11 deletions

View File

@ -76,11 +76,10 @@
;; -- Event Procssing Callbacks ;; -- Event Procssing Callbacks
(defn add-post-event-callback (defn add-post-event-callback
"Registers a callback function 'f'. "Registers a callback function `f` to be called after each event is procecessed
f will be called after each dispatched event is procecessed `f` will be called with two arguments:
f will be called with two arguments: - `event`: a vector. The event just processed.
- the event's vector. That which was dispatched orignally. - `queue`: a PersistentQueue, possibly empty, of events yet to be processed.
- the further event queue - what is still to be processed. A PersistentQueue.
This is useful in advanced cases like: This is useful in advanced cases like:
- you are implementing a complex bootstrap pipeline - you are implementing a complex bootstrap pipeline
@ -88,7 +87,8 @@
handlers for the one event, etc. Hook in here. handlers for the one event, etc. Hook in here.
- libraries providing 'isomorphic javascript' rendering on Nodejs or Nashorn. - libraries providing 'isomorphic javascript' rendering on Nodejs or Nashorn.
'id' is typically a keyword. 'id' is typically a keyword. It is an identifier, supplied initially
at \"add time\", which can be subsequently be used to remove a callback.
" "
([f] ([f]
(router/add-post-event-callback re-frame.router/event-queue f f)) (router/add-post-event-callback re-frame.router/event-queue f f))