Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
6db03eee83 | |||
efc5b54d2e |
@ -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",
|
||||
|
@ -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'
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user