fix event-bus:subscribe

seems to be a Fennel bug:
<andreyorst> the problem is that tset is taken out of the or and nil is placed in place of it, thus making side effect occur
<andreyorst> even though it shouldn't
<andreyorst> telent: good catch
phoen
Daniel Barlow 2022-02-08 17:18:31 +00:00
parent cba16113a1
commit be829d3cc0
1 changed files with 1 additions and 1 deletions

View File

@ -21,7 +21,7 @@
(fn event-bus []
(let [subscriptions {}
vivify (fn [n v]
(or (. n v) (tset n v {}))
(tset n v (or (. n v) []))
(. n v))]
{
:subscriptions subscriptions