pub fn use_slice_value<T>() -> Rc<T> where
    T: Slice + 'static, 
Expand description

A read-only hook to connect to the value of a Slice.

Returns Rc<T>.

Example

#[function_component(CounterComp)]
fn counter_comp() -> Html {
    let ctr = use_slice_value::<Counter>();

    html! {
        <div>
            <div>{"Current Counter: "}{ctr.0}</div>
        </div>
    }
}