UNPKG

@datorama/akita

Version:

State Management Tailored-Made for JS Applications

27 lines (26 loc) 1.35 kB
import { QueryEntity } from '../queryEntity'; import { Query } from '../query'; export declare type Queries<State> = Query<State> | QueryEntity<State>; export declare abstract class AkitaPlugin<State = any> { protected query: Queries<State>; protected constructor(query: Queries<State>, config?: { resetFn?: Function; }); /** This method is responsible for getting access to the query. */ protected getQuery(): Queries<State>; /** This method is responsible for getting access to the store. */ protected getStore(): any; /** This method is responsible for cleaning. */ abstract destroy(): any; /** This method is responsible tells whether the plugin is entityBased or not. */ protected isEntityBased(entityId: any): boolean; /** This method is responsible for selecting the source; it can be the whole store or one entity. */ protected selectSource(entityId: any): import("rxjs").Observable<import("..").Diff<import("..").getEntityType<State>, null>> | import("rxjs").Observable<State>; protected getSource(entityId: any): any; /** This method is responsible for updating the store or one entity; it can be the whole store or one entity. */ protected updateStore(newState: any, entityId?: any): void; /** * Function to invoke upon reset */ private onReset; }