@zeix/cause-effect
Version:
Cause & Effect - reactive state management with signals.
22 lines (19 loc) • 493 B
text/typescript
/** interface for a reactive framework.
*
* Implement this interface to add a new reactive framework to the test and performance test suite.
*/
export interface ReactiveFramework {
name: string;
signal<T>(initialValue: T): Signal<T>;
computed<T>(fn: () => T): Computed<T>;
effect(fn: () => void): void;
withBatch<T>(fn: () => T): void;
withBuild<T>(fn: () => T): T;
}
export interface Signal<T> {
read(): T;
write(v: T): void;
}
export interface Computed<T> {
read(): T;
}