Skip to content

Instantly share code, notes, and snippets.

@venil7
Created August 26, 2018 13:24
Show Gist options
  • Save venil7/7a1083ec821285f10f2e1db43a6fa6cf to your computer and use it in GitHub Desktop.
Save venil7/7a1083ec821285f10f2e1db43a6fa6cf to your computer and use it in GitHub Desktop.
ReasonReact reducer component boilerplate
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