pub fn split(
        &self,
    ) -> (impl Fn() -> Rc<T> + Copy + '_, impl Fn(T) + Copy + '_) {
        let getter = move || self.get();
        let setter = move |x| self.set(x);
        (getter, setter)
    }
/// Split a signal into getter and setter handles.
///
/// # Example
/// ```rust
/// # use sycamore_reactive::*;
/// # create_scope_immediate(|ctx| {
/// let (state, set_state) = ctx.create_signal(0).split();
/// assert_eq!(*state(), 0);
///
/// set_state(1);
/// assert_eq!(*state(), 1);
/// # });
/// ```
Split a signal into getter and setter handles.
Split a signal into getter and setter handles .
pub fn split(
        &self,
    ) -> (impl Fn() -> Rc<T> + Copy + '_, impl Fn(T) + Copy + '_) {
        let getter = move || self.get();
        let setter = move |x| self.set(x);
        (getter, setter)
    }
pub fn split ( & self , ) -> ( impl Fn ( ) -> Rc < T > + Copy + ' _ , impl Fn ( T ) + Copy + ' _ ) { let getter = move | | self . get ( ) ; let setter = move | x | self . set ( x ) ; ( getter , setter ) }
Split a signal into getter and setter handles.
Split a signal into getter and setter handles .
&self
&self
example
None
use sycamore_reactive::*;
None
create_scope_immediate(|ctx| {
let (state, set_state) = ctx.create_signal(0).split();
assert_eq!(*state(), 0).


let ( state set_state ) = ctx . create_signal ( 0 ) . split () ; assert_eq! ( * state () 0 ) .
});
None