Crate floem_reactive

source ·

Structs

  • Memo computes the value from the closure on creation, and stores the value. It will act like a Signal when the value is different with the computed value from last run, i.e., it will trigger a effect run when you Get() it whenever the computed value changes to a different value.
  • A getter only Signal
  • A read write Signal which can acts as both a Getter and a Setter
  • You can manually control Signal’s lifetime by using Scope. Every Signal has a Scope created explictly or implicity, and when you Dispose the Scope, it will clean up all the Signals that belong to the Scope and all the child Scopes
  • A setter only Signal

Functions

  • Wrap the closure so that whenever the closure runs, it will be under a child Scope of the current Scope
  • Create an Effect that runs the given function whenever the Signals that subscribed to it in the function.
  • Create a Memo which takes the computed value of the given function, and triggers the reactive system when the computed value is different with the last computed value.
  • Creates a new RwSignal which can act both as a setter and a getter. Accessing the signal value in an Effect will make the Effect subscribes to the value change of the Signal. And whenever the signal value changes, it will trigger an effect run.
  • Creates a new setter and getter Signal. Accessing the signal value in an Effect will make the Effect subscribes to the value change of the Signal. And whenever the signal value changes, it will trigger an effect run.
  • Create an effect updater that runs on_change when any signals compute subscribes to changes. compute is immediately run and its return value is returned from create_updater.
  • Create an effect updater that runs on_change when any signals compute subscribes to changes. compute is immediately run and its return value is returned from create_updater.
  • Sets a context value to be stored in the reative system. The stored context value can be retrieved from anywhere by using use_context
  • Signals that’s wrapped this untrack will not subscribe to any effect
  • Try to retrieve a stored Context value in the reactive system. You can store a Context value anywhere, and retrieve it from anywhere afterwards.
  • Runs the given code with the given Scope