File tree Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Expand file tree Collapse file tree 1 file changed +14
-9
lines changed Original file line number Diff line number Diff line change @@ -106,14 +106,19 @@ buildProp emit el = render
106
106
Fn .runFn3 setProperty prop val el
107
107
pure v
108
108
Handler (DOM.EventType ty) f → do
109
- ref ← Ref .newRef f
110
- let
111
- listener = DOM .eventListener \ev → do
112
- f' ← Ref .readRef ref
113
- mbEmit (f' ev)
114
- Fn .runFn3 Util .pokeMutMap ty (Tuple listener ref) events
115
- Fn .runFn3 Util .addEventListener ty listener el
116
- pure v
109
+ case Fn .runFn2 Util .unsafeGetAny ty events of
110
+ handler | Fn .runFn2 Util .unsafeHasAny ty events → do
111
+ Ref .writeRef (snd handler) f
112
+ pure v
113
+ _ → do
114
+ ref ← Ref .newRef f
115
+ let
116
+ listener = DOM .eventListener \ev → do
117
+ f' ← Ref .readRef ref
118
+ mbEmit (f' ev)
119
+ Fn .runFn3 Util .pokeMutMap ty (Tuple listener ref) events
120
+ Fn .runFn3 Util .addEventListener ty listener el
121
+ pure v
117
122
Ref f → do
118
123
mbEmit (f (Created el))
119
124
pure v
@@ -138,7 +143,7 @@ buildProp emit el = render
138
143
Fn .runFn3 setProperty prop2 val2 el
139
144
pure v2
140
145
_ →
141
- pure v2
146
+ Util .effPure v2
142
147
_, _ → do
143
148
Fn .runFn3 setProperty prop2 val2 el
144
149
pure v2
You can’t perform that action at this time.
0 commit comments