Compare commits

...

2 Commits

Author SHA1 Message Date
6db03eee83 2.0.5 2023-04-12 20:34:34 +02:00
efc5b54d2e fix(core): update 2023-04-12 20:34:34 +02:00
3 changed files with 7 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@pushrocks/smartstate",
"version": "2.0.4",
"version": "2.0.5",
"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: '@pushrocks/smartstate',
version: '2.0.4',
version: '2.0.5',
description: 'a package that handles state in a good way'
}

View File

@ -111,9 +111,11 @@ export class StatePart<TStatePartName, TStatePayload> {
/**
* is executed
*/
public stateSetup(
funcArg: (statePartArg?: StatePart<any, TStatePayload>) => Promise<TStatePayload | void>
public async stateSetup(
funcArg: (statePartArg?: StatePart<any, TStatePayload>) => Promise<TStatePayload>
) {
this.cumulativeDeferred.addPromise(funcArg(this));
const resultPromise = funcArg(this);
this.cumulativeDeferred.addPromise(resultPromise);
this.setState(await resultPromise);
}
}