Skip to content

Commit 4c3e49c

Browse files
committed
Fix wrapper lifecycle bugs
1 parent 20c4036 commit 4c3e49c

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/cljfx/dev.clj

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,9 @@
241241
(load "dev/validation")
242242

243243
(defn wrap-type->lifecycle [type->lifecycle]
244-
(fn [type]
245-
(wrap-lifecycle type type->lifecycle)))
244+
(let [f (memoize wrap-lifecycle)]
245+
(fn [type]
246+
(f type type->lifecycle))))
246247

247248
(def type->lifecycle
248249
(wrap-type->lifecycle (some-fn fx/keyword->lifecycle fx/fn->lifecycle)))

src/cljfx/dev/validation.clj

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,4 @@
8686
opts (assoc opts ::stack stack)]
8787
(try
8888
(lifecycle/delete lifecycle component opts)
89-
(catch Exception ex (re-throw-with-stack ex stack))))
90-
(lifecycle/delete lifecycle component opts)))))
89+
(catch Exception ex (re-throw-with-stack ex stack))))))))

0 commit comments

Comments
 (0)