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(socket: Socket, initial: a, reducer: fn(a, b) -> a, cb: fn(
    Socket,
    State(a, b),
  ) -> #(Socket, List(Element))) -> #(Socket, List(Element))
Search Document