Function use_ref

Source
pub fn use_ref<T: 'static>(
    cx: ScopeState<'_>,
    make_value: impl FnOnce() -> T,
) -> &T
Expand description

Use an immutable reference to a value of type T.

make_value will only be called once to initialize this value.