File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed
Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change 1919-- |
2020-- | Then we would write
2121-- | ```
22- -- | data Color = Red | Green | Blue
22+ -- | data Color
23+ -- | = Red
24+ -- | | Green
25+ -- | | Blue
2326-- |
24- -- | -- Note: see docs on `EventHandle` for the below naming convention justification of suffixing `H`.
25- -- | barH :: EventHandle Foo (Maybe Error -> Color -> Effect Unit) (EffectFn1 (Nullable Error) String Unit)
26- -- | barH = EventHandle "bar" $ \psCb -> mkEffectFn2 \nullableError str ->
27- -- | psCb (toMaybe nullableError) case str of
28- -- | "red" -> Red
29- -- | "green" -> Green
30- -- | "blue" -> Blue
31- -- | _ -> unsafeCrashWith $ "Impossible String value for event 'bar': " <> show str
27+ -- | -- Note: see docs on `EventHandle`
28+ -- | -- for the below naming convention justification
29+ -- | -- of suffixing an event name with `H`.
30+ -- | barH
31+ -- | :: EventHandle
32+ -- | Foo
33+ -- | (Maybe Error -> Color -> Effect Unit)
34+ -- | (EffectFn1 (Nullable Error) String Unit)
35+ -- | barH = EventHandle "bar" $ \psCb ->
36+ -- | mkEffectFn2 \nullableError str ->
37+ -- | psCb (toMaybe nullableError) case str of
38+ -- | "red" -> Red
39+ -- | "green" -> Green
40+ -- | "blue" -> Blue
41+ -- | _ ->
42+ -- | unsafeCrashWith $
43+ -- | "Impossible String value for event 'bar': " <> show str
3244-- | ```
3345-- |
3446-- | ## Emitting events via an `EventEmitter`
You can’t perform that action at this time.
0 commit comments