Add wrap and new cursor functionality to core.cljs

This commit is contained in:
Dan Holmsand 2014-11-13 19:59:42 +01:00
parent 02ffe6bcfa
commit e76c4b9c72
1 changed files with 8 additions and 1 deletions

View File

@ -152,6 +152,12 @@ re-rendered."
([x] (ratom/atom x))
([x & rest] (apply ratom/atom x rest)))
(defn wrap
[value reset-fn & args]
(util/make-wrapper value reset-fn args))
;; RCursor
(defn cursor
@ -165,7 +171,8 @@ the specified path within the wrapped Reagent atom. e.g.,
... (swap! c inc) ;; equivalence to (swap! ra update-in [:nested :content] inc)
)"
([path] (fn [ra] (cursor path ra)))
([path ra] (ratom/cursor path ra)))
([path ra] (ratom/cursor path ra))
([path ra reset-fn & args] (ratom/cursor path ra reset-fn args)))
;; Utilities