Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 870 Bytes

README.md

File metadata and controls

47 lines (35 loc) · 870 Bytes

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.