inFlight
inFlight(effects)
Motivation
Method allows to calculate total current in flight states of each passed effect. It is useful when you want to show pending state of complex process.
Formulae
- Count all pending runs of effects in one store
Arguments
effects
(Array<Effect<any, any, any>>)
- array of any effects
Returns
$count
(Store<number>)
- Store with count of run effects in pending state
Example
inFlight({ domain })
Motivation
This overload allows to count effects in flight of the whole domain. It is useful when you want to show loading state of the whole application.
Formulae
- Count all pending runs of effects in passed domain in one store
Arguments
domain
(Domain)
- domain to count effects from
Returns
$count
(Store<number>)
- Store with count of run effects in pending state
Example
inFlight({ effects: [] })
Motivation
This overload receives effects
as an object. May be useful for additional clarity, but it’s longer to write
Formulae
- Count all pending runs of effects in one store
Arguments
effects
(Array<Effect<any, any, any>>)
- array of any effects
Returns
$count
(Store<number>)
- Store with count of run effects in pending state