From efc5b54d2e08e7fd65bc7904014164954d451009 Mon Sep 17 00:00:00 2001 From: Philipp Kunz Date: Wed, 12 Apr 2023 20:34:34 +0200 Subject: [PATCH] fix(core): update --- ts/00_commitinfo_data.ts | 2 +- ts/smartstate.classes.statepart.ts | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 819ce9d..998ff57 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -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' } diff --git a/ts/smartstate.classes.statepart.ts b/ts/smartstate.classes.statepart.ts index a2c4f68..b227ac4 100644 --- a/ts/smartstate.classes.statepart.ts +++ b/ts/smartstate.classes.statepart.ts @@ -111,9 +111,11 @@ export class StatePart { /** * is executed */ - public stateSetup( - funcArg: (statePartArg?: StatePart) => Promise + public async stateSetup( + funcArg: (statePartArg?: StatePart) => Promise ) { - this.cumulativeDeferred.addPromise(funcArg(this)); + const resultPromise = funcArg(this); + this.cumulativeDeferred.addPromise(resultPromise); + this.setState(await resultPromise); } }