Created
May 29, 2018 08:23
-
-
Save gladimdim/21d7df2062bf13ef41fbfba659560428 to your computer and use it in GitHub Desktop.
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 = 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