StreamHookStateExtension extension

Extension methods for HookState to handle Stream-based Hooks.

on

Methods

useStream<R>(Stream<R> stream, R initialValue) → R
Registers a StreamHook to listen to a Stream. Returns the latest value emitted by the Stream.
useStreamChanged<R>(Stream<R> stream, void callback(R state)) → void
Registers a StreamCallbackHook to listen to a Stream and execute a callback. The callback is executed every time the Stream emits a new value.