Compare commits
2 Commits
Author | SHA1 | Date | |
---|---|---|---|
5f5f9db884 | |||
876042b446 |
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@push.rocks/smartstate",
|
"name": "@push.rocks/smartstate",
|
||||||
"version": "2.0.10",
|
"version": "2.0.11",
|
||||||
"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",
|
||||||
|
@ -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.11',
|
||||||
description: 'a package that handles state in a good way'
|
description: 'a package that handles state in a good way'
|
||||||
}
|
}
|
||||||
|
@ -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();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user