fix(core): update

This commit is contained in:
Philipp Kunz 2023-04-12 20:34:34 +02:00
parent 9860e43398
commit efc5b54d2e
2 changed files with 6 additions and 4 deletions

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);
}
}