Skip to content

Instantly share code, notes, and snippets.

@gladimdim
Created May 29, 2018 08:23
Show Gist options
  • Select an option

  • Save gladimdim/21d7df2062bf13ef41fbfba659560428 to your computer and use it in GitHub Desktop.

Select an option

Save gladimdim/21d7df2062bf13ef41fbfba659560428 to your computer and use it in GitHub Desktop.
type state = string;
let action =
| Load
| Unload;
let component = ReasonReact.reducerComponent("New");
let make = _children => {
...component,
initialState: () => "Hi",
reducer: (action, _state) =>
switch (action) {
| Load => ReasonReact.Update("Hello")
| Unload => ReasonReact.Update("Hallo")
},
render: _self => <a />,
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment