bs-effector-react

20.0.0 • Public • Published

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>,
};

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.18.3-beta.10next
20.0.03latest

Version History

VersionDownloads (Last 7 Days)Published
20.0.03
19.0.00
0.18.30
0.18.3-beta.10
0.18.20
0.18.10
0.18.00
0.18.0-rc.40

Package Sidebar

Install

npm i bs-effector-react

Weekly Downloads

3

Version

20.0.0

License

MIT

Unpacked Size

3.93 kB

Total Files

5

Last publish

Collaborators

  • kireevmp
  • drevoed
  • drelliot
  • sergeysova
  • lobatik
  • zero_bias