UNPKG

@zeix/cause-effect

Version:

Cause & Effect - reactive state management primitives library for TypeScript.

22 lines (19 loc) 483 B
/** 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: () => undefined): 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 }