Skip to main content

remember

Function remember 

Source
pub fn remember<T: Clone + 'static>(init: impl FnOnce() -> T) -> T
Expand description

The value this call site remembered, or init()’s, kept for next time. Compose’s remember.

The value is returned by clone, so what is remembered is usually a handle: a MutableState, an Rc, a derived state. Outside a composition nothing is kept and init runs every time.