SignalSvc type
Home > @rimitive/react > SignalSvc
SignalSvc type
Section titled “SignalSvc type”Minimal service interface used by React bindings. Contains the core methods for creating and managing signals.
Signature:
export type SignalSvc = { signal: <T>(value: T) => Writable<T>; computed: <T>(compute: () => T) => Readable<T>; effect: (fn: () => void | (() => void)) => () => void; batch: <T>(fn: () => T) => T; dispose: () => void;};References: Writable, Readable
Example
Section titled “Example”import { compose } from '@rimitive/core';import { SignalModule, ComputedModule, EffectModule, BatchModule } from '@rimitive/signals/extend';
const svc: SignalSvc = compose(SignalModule, ComputedModule, EffectModule, BatchModule);