Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ecliptic/purescript-recompose
PureScript bindings for acdlite/recompose using purescript-react
https://github.com/ecliptic/purescript-recompose
javascript purescript react recompose
Last synced: about 2 months ago
JSON representation
PureScript bindings for acdlite/recompose using purescript-react
- Host: GitHub
- URL: https://github.com/ecliptic/purescript-recompose
- Owner: ecliptic
- License: mit
- Created: 2016-08-05T21:32:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2017-03-07T18:27:50.000Z (almost 8 years ago)
- Last Synced: 2024-04-24T15:09:38.571Z (9 months ago)
- Topics: javascript, purescript, react, recompose
- Language: PureScript
- Size: 56.6 KB
- Stars: 11
- Watchers: 2
- Forks: 1
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# purescript-recompose
[![Latest release](https://img.shields.io/npm/v/purescript-recompose.svg)](https://github.com/ecliptic/purescript-recompose/releases)
[![Latest release](https://img.shields.io/bower/v/purescript-recompose.svg)](https://github.com/ecliptic/purescript-recompose/releases)
[![recompose channel on discord](https://img.shields.io/badge/discord-%23recompose%20%40%20reactiflux-61dafb.svg?style=flat-square)](https://discord.gg/2PCKqHc)
[![Build Status](https://travis-ci.org/ecliptic/purescript-recompose.svg?branch=master)](https://travis-ci.org/ecliptic/purescript-recompose)A PureScript interface to [recompose](https://github.com/acdlite/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.
* [`purescript-recompose` API documentation](https://github.com/ecliptic/purescript-recompose/blob/master/docs/React/Recompose.md)
* [Original `recompose` API documentation](https://github.com/acdlite/recompose/blob/master/docs/API.md)
* [Example TodoMVC implementation](https://github.com/ecliptic/purescript-recompose-todomvc)## Usage
Install with bower:
$ bower install --save purescript-recompose
Compose with your existing components:
```purescript
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 UnitaddTodo :: 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