Skip to content

Commit cf5e836

Browse files
committed
[flows] Memoize topsort correctly
1 parent 09e2d71 commit cf5e836

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/re_frame/flow/alpha.cljc

+3-1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
reverse
3333
(map flows)))
3434

35+
(def topsort* (memoize topsort))
36+
3537
(defn default [id]
3638
{:id id
3739
:path [id]
@@ -169,6 +171,6 @@
169171
:after (comp (fn [ctx]
170172
(let [all-flows (with-cleared @flows)]
171173
(swap! flows vary-meta dissoc ::cleared)
172-
(reduce run ctx ((memoize topsort) all-flows))))
174+
(reduce run ctx (topsort* all-flows))))
173175
(fn [{{:keys [db]} :effects :as ctx}]
174176
(assoc ctx :re-frame/pre-flow-db db)))}))

0 commit comments

Comments
 (0)