Skip to content

handleEffects

handleEffects<EffectsConfig, Exhaustive>(effects: undefined | EffectMatchbox[], matchers: MatchCases<EffectsConfig, any, Exhaustive>, exhaustive: Exhaustive): void

Defined in: extras/effects.ts:45

Handles an array of effect matchboxes by matching them against provided cases.

Use cases:

  • Executing effect handlers based on effect type
  • Ensuring exhaustive handling of all effect cases
Type ParameterDefault typeDescription
EffectsConfig extends TaggedTypes-The tagged types configuration for effects
Exhaustive extends booleantrueWhether exhaustive matching is required
ParameterTypeDescription
effectsundefined | EffectMatchbox[]Array of effect matchboxes to handle
matchersMatchCases<EffectsConfig, any, Exhaustive>Object mapping effect types to handler functions
exhaustiveExhaustiveWhether to enforce exhaustive matching (default: false)

void