Skip to content

Commit

Permalink
Fix type warning, and export handler_ (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
paf31 authored May 4, 2018
1 parent 0897e02 commit b34095f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
15 changes: 15 additions & 0 deletions generated-docs/React/Basic/Events.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,21 @@ input { onChange: handler targetValue
}
```

#### `handler_`

``` purescript
handler_ :: Eff (react :: ReactFX) Unit -> EventHandler
```

Create an `EventHandler` which discards the `SyntheticEvent`.

For example:

```purs
input { onChange: handler_ (setState \_ -> { value })
}
```

#### `merge`

``` purescript
Expand Down
3 changes: 2 additions & 1 deletion src/React/Basic/Events.purs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ module React.Basic.Events
, EventFn
, unsafeEventFn
, handler
, handler_
, merge
, class Merge
, mergeImpl
Expand Down Expand Up @@ -68,7 +69,7 @@ handler (EventFn fn) cb = mkEffFn1 $ fn >>> cb
-- | input { onChange: handler_ (setState \_ -> { value })
-- | }
-- | ```
handler_ :: forall a. Eff (react :: ReactFX) Unit -> EventHandler
handler_ :: Eff (react :: ReactFX) Unit -> EventHandler
handler_ = mkEffFn1 <<< const

class Merge (rl :: RowList) fns a r | rl -> fns, rl a -> r where
Expand Down

0 comments on commit b34095f

Please sign in to comment.