pub fn use_context_or_else_ref<'a, T, F>(cx: Scope<'a>, f: F) -> &'a Twhere
    T: 'static,
    F: FnOnce() -> &'a T,
Expand description

Gets a context value of the given type or computes it from a closure.

Unlike provide_context, this closure should return a reference that lives at least as long as the scope.

Note that if no context exists, the new context will be created in the current scope. This means that the new value will still be inaccessible in an outer scope.