mirror of
https://github.com/status-im/re-frame.git
synced 2025-02-22 14:58:12 +00:00
Follow suggestion from @whodidthis and include "v" into after and enrich
This commit is contained in:
parent
ef9dad529a
commit
f5ee682487
@ -130,7 +130,7 @@
|
||||
|
||||
(defn enrich
|
||||
"Middleware factory which runs a given function \"f\" in the after position.
|
||||
\"f\" is (db) -> db
|
||||
\"f\" is (db v) -> db
|
||||
Unlike \"after\" which is about side effects, \"enrich\" expects f to process and alter
|
||||
db in some useful way, contributing to the derived data, flowing vibe.
|
||||
Imagine that todomvc needed to do duplicate detection - if any two todos had
|
||||
@ -151,7 +151,7 @@
|
||||
[handler]
|
||||
(fn validate-handler
|
||||
[db v]
|
||||
(f (handler db v))))) ;; (comp f handler)
|
||||
(f (handler db v) v))))
|
||||
|
||||
|
||||
|
||||
@ -168,7 +168,7 @@
|
||||
(fn after-handler
|
||||
[db v]
|
||||
(let [new-db (handler db v)]
|
||||
(f new-db) ;; call f for side effects
|
||||
(f new-db v) ;; call f for side effects
|
||||
new-db))))
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user