[][src]Module valerie::state

Contains the structs for defining States

State variables handles the core functionality in valerie.

When a change happens, the change is propagated to all the elements using the state variables using channels. The value passed is Channel. Whenever the update function is called, the State variable updates its value across all the places in the DOM.

This is achieved using message passing concurrency. Each place where the state is used, It also spawns an async function with the receiver that waits for a message from the sender. When the sender sends the message receiver updates the value associated.

Structs

StateAtomic

State variable to be used with types that implement Copy

StateGeneric

A generic State type

StateMutex

State variable to be used with types that implement Clone

StateVec

A vector of States

Traits

StateTrait

Trait that State types have to implement