Skip to main content

remember_with_key

Function remember_with_key 

Source
pub fn remember_with_key<K, F, T>(key: K, init: F) -> State<T>
where K: Hash, F: FnOnce() -> T, T: Send + Sync + 'static,
Expand description

Initializes state by an explicit key within the current component build.

Use stable business keys for reordered collections. The initializer runs only when the slot is first used; see State for access and lifetime rules.