Compare commits

...

4 Commits

Author SHA1 Message Date
776eba09e9 2.0.12 2023-10-03 12:47:38 +02:00
b41ff5d495 fix(core): update 2023-10-03 12:47:38 +02:00
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", "name": "@push.rocks/smartstate",
"version": "2.0.10", "version": "2.0.12",
"private": false, "private": false,
"description": "a package that handles state in a good way", "description": "a package that handles state in a good way",
"main": "dist_ts/index.js", "main": "dist_ts/index.js",

View File

@ -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.12',
description: 'a package that handles state in a good way' 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 * 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();
} }
/** /**