Module sycamore::reactive

source ·
Expand description

Re-export of the sycamore-reactive crate.

Reactive primitives for Sycamore.

Structs§

  • A handle to a reactive node (signal, memo, effect) that lets you run further tasks in it or manually dispose it.
  • A read-only reactive value.
  • A handle to a root. This lets you reinitialize or dispose the root for resource cleanup.
  • A reactive value that can be read and written to.

Traits§

  • A trait that is implemented for reactive data that can be accessed and tracked, such as Signal.
  • A trait that is implemented for reactive data that can be tracked, such as Signal.

Functions§

  • Batch updates from related signals together and only run memos and effects at the end of the scope.
  • Create a child scope.
  • Creates an effect on signals used inside the effect closure.
  • Creates a memoized computation from some signals. The output is derived from all the signals that are used within the memo closure. If any of the tracked signals are updated, the memo is also updated.
  • An alternative to create_signal that uses a reducer to get the next value.
  • Creates a new reactive root with a top-level [Scope]. The returned RootHandle can be used to dispose the root.
  • Creates a memoized value from some signals. Unlike create_memo, this function will not notify dependents of a hange if the output is the same. That is why the output of the function must implement PartialEq.
  • Creates a memoized value from some signals. Unlike create_memo, this function will not notify dependents of a change if the output is the same.
  • Create a new Signal.
  • Create an Accessor that represents a derived signal.
  • Function that maps a Vec to another Vec via a map function. The mapped Vec is lazy computed, meaning that it’s value will only be updated when requested. Modifications to the input Vec are diffed by index to prevent recomputing values that have not changed.
  • Function that maps a Vec to another Vec via a map function. The mapped Vec is lazy computed, meaning that it’s value will only be updated when requested. Modifications to the input Vec are diffed using keys to prevent recomputing values that have not changed.
  • A helper function for making dependencies explicit.
  • Adds a callback that is called when the scope is destroyed.
  • Provide a context value in this scope.
  • Tries to get a context value of the given type. If no context is found, returns None.
  • Run the passed closure inside an untracked dependency scope.
  • Get a context with the given type. If no context is found, this panics.
  • Try to get a context with the given type. If no context is found, returns the value of the function and sets the value of the context in the current scope.
  • Get a handle to the current reactive scope.
  • Get a handle to the root reactive scope.
  • Gets how deep the current scope is from the root/global scope. The value for the global scope itself is always 0.