UNPKG

syncbasestore

Version:

Lightweight reactive store with built-in filtering and async state handling

14 lines (13 loc) 535 B
import { SyncBaseStore } from '../store/SyncBaseStore'; export declare function tileBase<T, K extends keyof T>(store: SyncBaseStore<T>, key: K): { get(): T[K]; getField(path: string): any; set(value: T[K]): void; update(updater: (prev: T[K]) => T[K]): void; setField(path: string, value: any): void; claim<R>(selector: (tile: T[K]) => R): () => R; target(path: string): (value: any) => void; clear(): void; clearOnly(...fields: (keyof T[K])[]): void; clearKeep(fields: (keyof T[K])[]): void; };