gwi/gwi_unsafe
Types
An Unsafe output.
pub type UnsafeOutput(model, view) {
OkOutput(model: model, view: view)
ErrorOutput(error: String)
}
Constructors
-
OkOutput(model: model, view: view) -
ErrorOutput(error: String)
Values
pub fn process(
model model: option.Option(model),
msg msg: dynamic.Dynamic,
input_handler input_handler: fn(option.Option(model), msg) -> Result(
#(model, view),
error,
),
msg_decoder msg_decoder: fn() -> decode.Decoder(msg),
) -> UnsafeOutput(model, view)
pub fn process_init(
msg msg: dynamic.Dynamic,
input_handler input_handler: fn(option.Option(model), msg) -> Result(
#(model, view),
error,
),
msg_decoder msg_decoder: fn() -> decode.Decoder(msg),
) -> UnsafeOutput(model, view)
Deprecated: Use the `gwi.process` funtion instead. This function will be removed in the future. Do not use this if you don't know what you are doing.
Take a msg and a None as model, put them through the input handler
funtion then return the result.
Error will crash the thread.
pub fn process_update(
model model: model,
msg msg: dynamic.Dynamic,
input_handler input_handler: fn(option.Option(model), msg) -> Result(
#(model, view),
error,
),
msg_decoder msg_decoder: fn() -> decode.Decoder(msg),
) -> UnsafeOutput(model, view)
Deprecated: Use the `gwi.process` funtion instead. This function will be removed in the future. Do not use this if you don't know what you are doing.
Take a model and a msg, put them through the input handler funtion
then return the result.
Error will crash the thread.