fix(core): update

This commit is contained in:
Philipp Kunz 2023-10-03 12:47:12 +02:00
parent df2924577b
commit 876042b446
2 changed files with 4 additions and 3 deletions

View File

@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartstate',
version: '2.0.10',
version: '2.0.11',
description: 'a package that handles state in a good way'
}

View File

@ -116,10 +116,11 @@ export class StatePart<TStatePartName, TStatePayload> {
/**
* 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;
const newState = await stateAction.actionDef(this, actionPayload);
this.setState(newState);
await this.setState(newState);
return this.getState();
}
/**