Skip to main content

retain_with_key

Function retain_with_key 

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

Initializes keyed state during a build and keeps it until the component unmounts.

Unused retained slots survive conditional branches; see State for access rules and StateOwner for independent controller or route lifetimes.