update action generation
This commit is contained in:
@ -1,8 +1,13 @@
|
||||
import * as plugins from './smartstate.plugins';
|
||||
import { StatePart } from './smartstate.classes.statepart';
|
||||
|
||||
export interface IActionDef<TStateType, TActionPayloadType> {
|
||||
(stateArg: StatePart<any, TStateType>, actionPayload: TActionPayloadType): Promise<TStateType>;
|
||||
}
|
||||
|
||||
/**
|
||||
* an actionmodifier for the state
|
||||
*/
|
||||
export class StateAction<StatePayload> {
|
||||
constructor(public actionDef: (stateArg: StatePayload) => StatePayload) {}
|
||||
export class StateAction<TStateType, TActionPayloadType> {
|
||||
constructor(public actionDef: IActionDef<TStateType, TActionPayloadType>) {}
|
||||
}
|
||||
|
Reference in New Issue
Block a user