Skip to content

giraud/bs-recoil

Repository files navigation

bs-recoil

Experimental Rescript bindings to recoil.

Usage

Create an atom:

let todoListState = Recoil.Atom.value(~key="todoListState", ~default=[||]: array(Todo.t), ())->Recoil.Atom.make;

Create a getter:

let filteredTodoListState =
  Recoil.Selector.value(
    ~key="filteredTodoListState",
    ~get=({get}) => { ... },
    (),
  )
  ->Recoil.Selector.make;

Create a setter:

let filteredTodoListState =
  Recoil.Selector.value(
    ~key="filteredTodoListState",
    ~get=({get}) => { ... },
    ~set=({get, set}) => { ... },
    (),
  )
  ->Recoil.Selector.make;

Dev

example directory contains the todo app from the recoil doc

Code doc is copied from recoil documentation site.

About

ReasonML bindings to recoil

Resources

License

Stars

Watchers

Forks

Packages

No packages published