Created
August 26, 2018 13:24
-
-
Save venil7/7a1083ec821285f10f2e1db43a6fa6cf to your computer and use it in GitHub Desktop.
ReasonReact reducer component boilerplate
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
type state = {a: int}; | |
type action = | |
| Remove | |
| Add | |
| Update; | |
let component = ReasonReact.reducerComponent("ReducerComponent"); | |
let make = _children => { | |
...component, | |
initialState: () => 1, | |
reducer: (_action: action, _state: state) => ReasonReact.NoUpdate, | |
render: _self => <div> <ul /> </div>, | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment