novdom/state

Types

pub opaque type State(a)
pub type StateId =
  String

Functions

pub fn create(init: a) -> State(a)
pub fn create_with_id(id: String, init: a) -> State(a)
pub fn from_id(id: String) -> State(a)
pub fn listen(state: State(a), callback: fn(a) -> Nil) -> Nil
pub fn update(state: State(a), new: a) -> Nil

update value

pub fn value(state: State(a)) -> a

get value

Search Document