purescript-recompose
npm i purescript-recompose

purescript-recompose

PureScript bindings for acdlite/recompose using purescript-react

by ecliptic

1.1.0 (see all)License:MITTypeScript:Not Found
npm i purescript-recompose
Readme

purescript-recompose

Latest release Latest release recompose channel on discord Build Status

A PureScript interface to recompose, a “React utility belt for functional components and higher-order components”. Recompose provides a great way to access React’s features in a more functional way, and it defines many useful higher-order components for easy composition.

Usage

Install with bower:

    $ bower install --save purescript-recompose

Compose with your existing components:

newTodo :: ReactClass Unit
newTodo = withHandlers handlers $ myComponent
  where handlers = { addTodo }

type HandleAdd props eff =
  { add :: String -> Eff eff Unit | props } ->
  { target :: { value :: String } } ->
  Eff eff Unit

addTodo :: forall props eff. HandleAdd props eff
addTodo props event = props.add event.target.value

In this example, myComponent is an existing React component. newTodo is the resulting component after wrapping it with recompose’s withHandlers higher-order component.

License

MIT

Downloads/wk

11

GitHub Stars

11

LAST COMMIT

5yrs ago

MAINTAINERS

1

CONTRIBUTORS

1

OPEN ISSUES

4

OPEN PRs

0
VersionTagPublished
1.1.0
latest
6yrs ago
No alternatives found
No tutorials found
Add a tutorial