To read the full documentation for this module, please visit
https://lustre.build/api/lustre/effect
pub opaque type Effect(msg)
pub fn batch(effects: List(Effect(a))) -> Effect(a)
pub fn from(effect: fn(fn(a) -> Nil) -> Nil) -> Effect(a)
pub fn map(effect: Effect(a), f: fn(a) -> b) -> Effect(b)
pub fn none() -> Effect(a)
Typically our app’s update
function needs to return a tuple of
#(model, Effect(msg))
. When we don’t need to perform any side effects we
can just return none()
!