new StateUpdaterOnActions()
The state-updater-on-actions interface.
NOTE this isn't a real class, it's an interface because of JSDoc limitations. Related StackOverflow thread
NOTE this isn't a real class, it's an interface because of JSDoc limitations. Related StackOverflow thread
- Source:
Methods
call(action, params) → {Promise}
Calls an action with the passed parameters.
Parameters:
Name | Type | Description |
---|---|---|
action |
Action | The action to call. |
params |
* | The parameters to pass to the action when it will be called. |
- Source:
Returns:
- The promise that the action returns, or if it returns a
promise with the value returned by the
updateState
, it will
call the updateAction
function passed to the constructor by
parameter and if it returns a rejected promise, then it will be returned
such rejected promise.
- Type
- Promise
callCtx(action, ctx, params) → {Promise}
Calls an action using the specified context (e.g obj.action()) and the
passed parameters.
Parameters:
Name | Type | Description |
---|---|---|
action |
Action | The action to call. |
ctx |
* | The context to use for calling the action (i.e. `this` pointer). |
params |
* | The parameters to pass to the action when it will be called. |
- Source:
Returns:
- The promise that the action returns, or if it returns a
promise with the value returned by the
updateState
method, it
will call the updateAction
function passed to the constructor
by parameter and if it returns a rejected promise then it will be returned
such rejected promise.
- Type
- Promise
updateState() → {*}
Returns the value which the actions must resolve their returned promises when
they require an state update.
- Source:
Returns:
- The value DOES NOT matter as it's used internally to identify
that the update state action must be called.
- Type
- *