pending
pendings(effects)
Motivation
This overload allows to read pending state of passed effects. It is useful when you want to show loading state of the whole application.
Formulae
- When some of
effects
are in pending state, result will betrue
Arguments
effects
(Array<Effect<any, any, any>>)
- array of any effects
Returns
$inProcess
(Store<boolean>)
- Store with boolean state
Example
pending({ effects: [] })
Motivation
This overload receives effects
and optional of
strategy as an object. Useful when need to change strategy
Formulae
- When
effects
pending state, result will betrue
- The
of
parameter selects strategy
Arguments
effects
(Array<Effect<any, any, any>>)
- array of any effectsof
("some" | "every")
— Optional. Select strategy of combining pendings of different effects. Default"some"
Returns
$inProcess
(Store<boolean>)
- Store with boolean state
Example: show processing only when all effects are pending
pending({ domain })
Motivation
This overload allows to read pending state of created effects in the domain. It is useful when you want to show loading state of the whole application.
Formulae
- When an effect created in the
domain
in pending state, result will betrue
- The
of
parameter selects strategy
Arguments
domain
(Domain)
- Effector domain with at least one effectof
("some" | "every")
— Optional. Select strategy of combining pendings of different effects. Default"some"
Returns
$inProcess
(Store<boolean>)
- Store with boolean state
Example
Strategy
There available two options:
some
— default strategy whenof
parameter is not provided. At least one effect must be in pending state.every
— each effect must be in pending state.