lily

Lily: a component framework for Gleam with server-client state synchronisation.

Types

pub type Protocol(model, msg) =
  protocol.Protocol(model, msg)
pub type Serialiser(model, msg) =
  protocol.Serialiser(model, msg)
pub type Store(model, msg) =
  store.Store(model, msg)

Values

pub const apply: fn(store.Store(c, d), d) -> store.Store(c, d)
pub const decode: fn(String, protocol.Serialiser(y, z)) -> Result(
  protocol.Protocol(y, z),
  Nil,
)
pub const disconnect: fn(
  process.Subject(server.ServerEvent(ad)),
  String,
) -> Nil
pub const dispatch: fn(store.Store(e, f), e) -> store.Store(e, f)
pub const encode: fn(
  protocol.Protocol(w, x),
  protocol.Serialiser(w, x),
) -> String
pub const get_model: fn(store.Store(g, h)) -> g
pub const incoming: fn(
  process.Subject(server.ServerEvent(ae)),
  String,
  String,
) -> Nil
pub const live: fn(
  store.Store(q, r),
  String,
  fn(q) -> s,
  fn(s) -> List(component.Patch),
) -> store.Store(q, r)
pub const mount: fn(store.Store(o, p), String, String) -> store.Store(
  o,
  p,
)
pub const new_store: fn(a, fn(a, b) -> a) -> store.Store(a, b)
pub const send: fn(store.Store(i, j), j) -> store.Store(i, j)
pub const server_connect: fn(
  process.Subject(server.ServerEvent(ac)),
  String,
  process.Subject(String),
) -> Nil
pub const server_start: fn(
  store.Store(aa, ab),
  protocol.Serialiser(aa, ab),
) -> Result(
  process.Subject(server.ServerEvent(ab)),
  actor.StartError,
)
pub const simple: fn(
  store.Store(t, u),
  String,
  fn(t) -> v,
  fn(v) -> String,
) -> store.Store(t, u)
pub const subscribe: fn(store.Store(k, l), fn(k) -> Nil) -> #(
  store.Store(k, l),
  Int,
)
pub const unsubscribe: fn(store.Store(m, n), Int) -> store.Store(
  m,
  n,
)
Search Document