Skip to content

Commit

Permalink
Fix set-handle-change doall
Browse files Browse the repository at this point in the history
* Only call on seq
  • Loading branch information
luciodale committed Oct 25, 2020
1 parent 426049f commit d4e4911
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -33,7 +33,7 @@ As at this state you must be dying of curiosity, I will dive right into the impl
#### In Deps

```clojure
fork {:mvn/version "2.2.3"}
fork {:mvn/version "2.2.4"}
```

or
Expand Down
2 changes: 1 addition & 1 deletion project.clj
@@ -1,4 +1,4 @@
(defproject fork "2.2.3"
(defproject fork "2.2.4"
:description "Reagent & Re-Frame form library"
:url "https://github.com/luciodale/fork"
:license {:name "MIT"}
Expand Down
7 changes: 5 additions & 2 deletions src/fork/core.cljs
Expand Up @@ -150,8 +150,11 @@
[{:keys [value path]} state]
(let [path (if (vector? path) path [path])
current-value (get-in @state (cons :values path))
new-value (doall (if (fn? value) (value current-value) value))]
(swap! state assoc-in (cons :values path) new-value)))
new-value (if (fn? value) (value current-value) value)
resolved-new-value (if (seq? new-value)
(doall new-value)
new-value)]
(swap! state assoc-in (cons :values path) resolved-new-value)))

(defn set-handle-blur
[{:keys [value path]} state]
Expand Down

0 comments on commit d4e4911

Please sign in to comment.