You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_Note: Misusing the `EventFn`*constructor* is UNSAFE and should be avoided -- use the helper functions specific to your platform (such as `React.Basic.DOM.Events`)_
39
-
40
37
##### Instances
41
38
```purescript
42
39
Semigroupoid EventFn
43
40
Category EventFn
44
41
(IsSymbol l, RowCons l (EventFn a b) fns_rest fns, RowCons l b r_rest r, RowLacks l fns_rest, RowLacks l r_rest, Merge rest fns_rest a r_rest) => Merge (Cons l (EventFn a b) rest) fns a r
45
42
```
46
43
44
+
#### `unsafeEventFn`
45
+
46
+
```purescript
47
+
unsafeEventFn :: forall a b. (a -> b) -> EventFn a b
48
+
```
49
+
50
+
Unsafely create an `EventFn`. This function should be avoided.
51
+
Use the helper functions specific to your platform (such as `React.Basic.DOM.Events`).
Copy file name to clipboardExpand all lines: src/React/Basic/Events.purs
+7-3Lines changed: 7 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
1
moduleReact.Basic.Events
2
2
( EventHandler
3
3
, SyntheticEvent
4
-
, EventFn(..)
4
+
, EventFn
5
+
, unsafeEventFn
5
6
, handler
6
7
, merge
7
8
, classMerge
@@ -34,10 +35,13 @@ foreign import data SyntheticEvent :: Type
34
35
-- | \value -> setState \_ -> { value }
35
36
-- | }
36
37
-- | ```
37
-
-- |
38
-
-- | _Note: Misusing the `EventFn` *constructor* is UNSAFE and should be avoided -- use the helper functions specific to your platform (such as `React.Basic.DOM.Events`)_
39
38
newtypeEventFnab = EventFn (a->b)
40
39
40
+
-- | Unsafely create an `EventFn`. This function should be avoided.
41
+
-- | Use the helper functions specific to your platform (such as `React.Basic.DOM.Events`).
0 commit comments