@cervello/react
Version:
🤯 Simple, reactive, tiny and performant state-management library
14 lines (13 loc) • 368 B
TypeScript
type Noop = () => void;
type Observer<T> = {
id: string;
next: (value: T, subscriberId?: string) => void;
};
type Subscription = {
unsubscribe: Noop;
};
export type CacheableSubject<T> = {
subscribe: (value: Observer<T>) => Subscription;
} & Omit<Observer<T>, 'id'>;
export declare function createCacheableSubject<T>(): CacheableSubject<T>;
export {};