20.0.0 • Published 5 years ago
bs-effector-react v20.0.0
bs-effector-react
ReasonML bindings for effector-react.
Installation
npm install --save bs-effector-react
Then add bs-effector to bs-dependencies in your bsconfig.json
:
{
"bs-dependencies": ["bs-effector-react"]
}
Usage
open Effector;
let counter = Store.make(0);
let increment: Event.t(unit) = Event.make("increment");
counter
|> Store.watch(state => Js.log(state));
counter
|> Store.on(increment, (state, _) => state + 1);
let component = EffectorReact.createComponent(counter);
let make = (_children) => {
...component,
render: self =>
<div className="counter">
(ReasonReact.stringToElement("counter: " ++ string_of_int(self.state)))
<br />
<button onClick=(_ => increment())>
(ReasonReact.stringToElement("increment"))
</button>
</div>,
};
20.0.0
5 years ago
19.0.0
5 years ago
0.18.3
5 years ago
0.18.3-beta.1
5 years ago
0.18.2
5 years ago
0.18.1
5 years ago
0.18.0
5 years ago
0.18.0-rc.4
5 years ago
0.18.0-rc.3
5 years ago
0.18.0-rc.2
5 years ago