Compare commits

...

2 Commits

Author SHA1 Message Date
5f5f9db884 2.0.11 2023-10-03 12:47:13 +02:00
876042b446 fix(core): update 2023-10-03 12:47:12 +02:00
3 changed files with 5 additions and 4 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@push.rocks/smartstate",
"version": "2.0.10",
"version": "2.0.11",
"private": false,
"description": "a package that handles state in a good way",
"main": "dist_ts/index.js",

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();
}
/**