commit be829d3cc0868f1b48209441336263ba9a8fab85
parent cba16113a1c5d1e63903aeb77a0824c75bdab2e8
Author: Daniel Barlow <dan@telent.net>
Date: Tue, 8 Feb 2022 17:18:31 +0000
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
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/just/just.fnl b/just/just.fnl
@@ -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