@tacky/store
Version:
State management framework based on react
31 lines (30 loc) • 1.16 kB
TypeScript
import { EMaterialType } from '../interfaces';
import { ReactorConfig } from '../decorators/reactor';
export declare const materialCallStack: EMaterialType[];
/**
* Framework base class 'Domain', class must be extends this base class which is need to be observable.
*/
export declare class Domain<S = {}> {
private properties;
private reactorConfigMap;
constructor();
propertyGet(key: string | symbol | number, config: ReactorConfig): any;
propertySet(key: string | symbol | number, v: any, config: ReactorConfig): void;
private proxySet;
private proxyGet;
private proxyOwnKeys;
/**
* proxy value could be boolean, string, number, undefined, null, custom instance, array[], plainObject{}
* @todo: support Map、Set、WeakMap、WeakSet
*/
private proxyReactive;
/**
* the syntax sweet of updating state out of mutation
*/
$update<K extends keyof S>(obj: Pick<S, K> | S, actionName?: string): void;
/**
* observed value could be assigned value to @reactor only in @mutation/$update, otherwise throw error.
*/
private illegalAssignmentCheck;
private dispatch;
}