effectTriggered method

  1. @override
void effectTriggered(
  1. int effectId,
  2. int parentEffectId,
  3. dynamic label,
  4. dynamic effect,
)
override

Defines function type which is invoked when an effect triggered by the middleware

effectId Unique ID assigned to the yielded effect

parentEffectId ID of the parent Effect. In the case of a Race or parallel effect, all effects yielded inside will have the direct race/parallel effect as a parent. In case of a top-level effect, the parent will be the containing Saga

label In case of a Race/All effect, all child effects will be assigned as label the corresponding keys of the object passed to Race/All

effect The yielded effect itself

Implementation

@override
void effectTriggered(
    int effectId, int parentEffectId, dynamic label, dynamic effect) {
  var ed = _EffectDescription(
      effectId, parentEffectId, '${effect.runtimeType}', effect);

  _effectsById[effectId] = ed;
  _addChild(parentEffectId, effectId);

  _log();
}