fix(core): update
This commit is contained in:
parent
df2924577b
commit
876042b446
@ -3,6 +3,6 @@
|
|||||||
*/
|
*/
|
||||||
export const commitinfo = {
|
export const commitinfo = {
|
||||||
name: '@push.rocks/smartstate',
|
name: '@push.rocks/smartstate',
|
||||||
version: '2.0.10',
|
version: '2.0.11',
|
||||||
description: 'a package that handles state in a good way'
|
description: 'a package that handles state in a good way'
|
||||||
}
|
}
|
||||||
|
@ -116,10 +116,11 @@ export class StatePart<TStatePartName, TStatePayload> {
|
|||||||
/**
|
/**
|
||||||
* dispatches an action on the statepart level
|
* dispatches an action on the statepart level
|
||||||
*/
|
*/
|
||||||
public async dispatchAction<T>(stateAction: StateAction<TStatePayload, T>, actionPayload: T) {
|
public async dispatchAction<T>(stateAction: StateAction<TStatePayload, T>, actionPayload: T): Promise<TStatePayload> {
|
||||||
await this.cumulativeDeferred.promise;
|
await this.cumulativeDeferred.promise;
|
||||||
const newState = await stateAction.actionDef(this, actionPayload);
|
const newState = await stateAction.actionDef(this, actionPayload);
|
||||||
this.setState(newState);
|
await this.setState(newState);
|
||||||
|
return this.getState();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user