Pattern matching method, splits trigger unit (event, effect or store) into several events, which fires when trigger matches its comparator function.
trigger(Event | Effect | Store): Event, Effect or Store unit-trigger.
cases(Object): Schema of cases, which uses names of resulting events as keys, and comparator function((value) => Boolean)
(Object) - Object, having keys, defined in
cases argument, plus
__(two underscores) - which stands for
default (no matches met) case.
Note: Only the first met match will trigger resulting event