import { split } from "https://dotland.deno.dev/x/effector@effector-vue%4023.1.0/packages/effector/index.d.ts";
Chooses one of the cases by given conditions. It "splits" source unit into several events, which fires when payload matches their conditions. Works like pattern matching for payload values and external stores
Type Parameters
Match extends { [name: string]: (payload: S) => boolean; }
Chooses one of cases by given conditions. It "splits" source unit into several targets, which fires when payload matches their conditions. Works like pattern matching for payload values and external units
Parameters
config: { source: Source; match: Match; cases: Cases; clock: Clock; } extends infer Config ? Config extends { cases: CaseRecord; match: any; source: Unit<any>; clock: Unit<any> | Array<Unit<any>>; } ? Source extends Unit<any> ? Cases extends CaseRecord ? Clock extends Unit<any> | Array<Unit<any>> ? SplitType<Cases, Match, { source: Source; match: Match; cases: Cases; clock: Clock; }, Source> : { error: "clock should be a unit or array of units"; got: Clock; } : { error: "cases should be an object with units or arrays of units"; got: Cases; } : { error: "source should be a unit"; got: Source; } : Config extends { cases: CaseRecord; match: any; source: Unit<any>; } ? Source extends Unit<any> ? Cases extends CaseRecord ? SplitType<Cases, Match, { source: Source; match: Match; cases: Cases; }, Source> : { error: "cases should be an object with units or arrays of units"; got: Cases; } : { error: "source should be a unit"; got: Source; } : { error: "config should be object with fields \"source\", \"match\" and \"cases\""; got: Config; } : { error: "cannot infer config object"; }