sprocket/hooks/reducer

Types

pub type State(model, msg) {
  State(m: model, d: Updater(msg))
}

Constructors

  • State(m: model, d: Updater(msg))
pub type Updater(msg) =
  fn(msg) -> Nil

Functions

pub fn reducer(ctx: Context, initial: a, reducer: fn(a, b) -> a, cb: fn(
    Context,
    State(a, b),
  ) -> #(Context, List(Element))) -> #(Context, List(Element))
Search Document