AsKeySignal

Trait AsKeySignal 

Source
pub trait AsKeySignal<T: Hash> {
    // Required method
    fn key(&self) -> KeySignal<'_, T>;
}
Expand description

Extension to allow for tracking key changes. If I can get some changes into sycamore this should become redundant

§Usage

use sycamore_query::prelude::*;
 let signal = create_signal(cx, "Test");
// Updates every time signal changes
use_query(cx, ("hello", signal.key()), move || hello(signal.get().to_string());

Required Methods§

Source

fn key(&self) -> KeySignal<'_, T>

Creates a reference to the signal that tracks when it’s hashed (sycamore uses get_untracked in the Hash implementation for signals).

Implementations on Foreign Types§

Source§

impl<T: Hash> AsKeySignal<T> for ReadSignal<T>

Source§

fn key(&self) -> KeySignal<'_, T>

Implementors§