Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/effector/packages/effector/index.d.ts>guard

Business logic with ease ☄️
Latest
function guard
Deprecated
Deprecated

use sample({clock, source, filter, target}) instead

import { guard } from "https://deno.land/x/effector@effector-vue%4023.1.0/packages/effector/index.d.ts";

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
T extends Target = Target

Parameters

config: { source: S; clock: C; filter: (source: GetSource<S>, clock: GetClock<C>) => source is X; target: MultiTarget<T, X>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
S extends Source<A> = Source<A>
optional
T extends Target = Target

Parameters

config: { source: S; filter: (source: GetSource<S>) => source is X; target: MultiTarget<T, X>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

B
X extends GetClock<C>
optional
C extends Clock<B> = Clock<B>
optional
T extends Target = Target

Parameters

config: { clock: C; filter: (clock: GetClock<C>) => clock is X; target: MultiTarget<T, X>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>

Parameters

config: { source: S; clock: C; filter: (source: GetSource<S>, clock: GetClock<C>) => source is X; name?: string; greedy?: boolean; }

Returns

GuardResult<X>

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
S extends Source<A> = Source<A>

Parameters

config: { source: S; filter: (source: GetSource<S>) => source is X; name?: string; greedy?: boolean; }

Returns

GuardResult<X>

Method for conditional event routing.

Type Parameters

B
X extends GetClock<C>
optional
C extends Clock<B> = Clock<B>

Parameters

config: { clock: C; filter: (clock: GetClock<C>) => clock is X; name?: string; greedy?: boolean; }

Returns

GuardResult<X>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterSC<S, C> = GuardFilterSC<S, C>
optional
T extends Target = Target

Parameters

config: { source: S; clock: C; filter: F; target: MultiTarget<T, GetGuardSource<S, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

optional
A = any
optional
S extends Source<A> = Source<A>
optional
F extends GuardFilterS<S> = GuardFilterS<S>
optional
T extends Target = Target

Parameters

config: { source: S; filter: F; target: MultiTarget<T, GetGuardSource<S, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

optional
B = any
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterC<C> = GuardFilterC<C>
optional
T extends Target = Target

Parameters

config: { clock: C; filter: F; target: MultiTarget<T, GetGuardClock<C, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any

Parameters

config: { source: Unit<A>; clock: Unit<B>; filter: BooleanConstructor; name?: string; greedy?: boolean; }

Returns

GuardResult<NonFalsy<A>>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any

Parameters

config: { source: Unit<A>; clock: Unit<B>; filter: ((source: A, clock: B) => boolean) | Store<boolean>; name?: string; greedy?: boolean; }

Returns

GuardResult<A>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterSC<S, C> = GuardFilterSC<S, C>

Parameters

config: { source: S; clock: C; filter: F; name?: string; greedy?: boolean; }

Returns

GuardResult<GetGuardSource<S, F>>

Method for conditional event routing.

Type Parameters

optional
A = any

Parameters

config: { source: Unit<A>; filter: BooleanConstructor; name?: string; greedy?: boolean; }

Returns

GuardResult<NonFalsy<A>>

Method for conditional event routing.

Type Parameters

optional
A = any

Parameters

config: { source: Unit<A>; filter: ((source: A) => boolean) | Store<boolean>; name?: string; greedy?: boolean; }

Returns

GuardResult<A>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
S extends Source<A> = Source<A>
optional
F extends GuardFilterS<S> = GuardFilterS<S>

Parameters

config: { source: S; filter: F; name?: string; greedy?: boolean; }

Returns

GuardResult<GetGuardSource<S, F>>

Method for conditional event routing.

Type Parameters

optional
B = any

Parameters

config: { clock: Unit<B>; filter: BooleanConstructor; name?: string; greedy?: boolean; }

Returns

GuardResult<NonFalsy<B>>

Method for conditional event routing.

Type Parameters

optional
B = any

Parameters

config: { clock: Unit<B>; filter: ((clock: B) => boolean) | Store<boolean>; name?: string; greedy?: boolean; }

Returns

GuardResult<B>

Method for conditional event routing.

Type Parameters

optional
B = any
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterC<C> = GuardFilterC<C>

Parameters

config: { clock: C; filter: F; name?: string; greedy?: boolean; }

Returns

GuardResult<GetGuardClock<C, F>>

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
T extends Target = Target

Parameters

source: S
config: { clock: C; filter: (source: GetSource<S>, clock: GetClock<C>) => source is X; target: MultiTarget<T, X>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
S extends Source<A> = Source<A>
optional
T extends Target = Target

Parameters

source: S
config: { filter: (source: GetSource<S>) => source is X; target: MultiTarget<T, X>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>

Parameters

source: S
config: { clock: C; filter: (source: GetSource<S>, clock: GetClock<C>) => source is X; name?: string; greedy?: boolean; }

Returns

GuardResult<X>

Method for conditional event routing.

Type Parameters

A
X extends GetSource<S>
optional
S extends Source<A> = Source<A>

Parameters

source: S
config: { filter: (source: GetSource<S>) => source is X; name?: string; greedy?: boolean; }

Returns

GuardResult<X>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterSC<S, C> = GuardFilterSC<S, C>
optional
T extends Target = Target

Parameters

source: S
config: { clock: C; filter: F; target: MultiTarget<T, GetGuardSource<S, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

optional
A = any
optional
S extends Source<A> = Source<A>
optional
F extends GuardFilterS<S> = GuardFilterS<S>
optional
T extends Target = Target

Parameters

source: S
config: { filter: F; target: MultiTarget<T, GetGuardSource<S, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any

Parameters

source: Unit<A>
config: { clock: Unit<B>; filter: BooleanConstructor; name?: string; greedy?: boolean; }

Returns

GuardResult<NonFalsy<A>>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any

Parameters

source: Unit<A>
config: { clock: Unit<B>; filter: ((source: A, clock: B) => boolean) | Store<boolean>; name?: string; greedy?: boolean; }

Returns

GuardResult<A>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
B = any
optional
S extends Source<A> = Source<A>
optional
C extends Clock<B> = Clock<B>
optional
F extends GuardFilterSC<S, C> = GuardFilterSC<S, C>

Parameters

source: S
config: { clock: C; filter: F; name?: string; greedy?: boolean; }

Returns

GuardResult<GetGuardSource<S, F>>

Method for conditional event routing.

Type Parameters

optional
A = any

Parameters

source: Unit<A>
config: { filter: BooleanConstructor; name?: string; greedy?: boolean; }

Returns

GuardResult<NonFalsy<A>>

Method for conditional event routing.

Type Parameters

optional
A = any

Parameters

source: Unit<A>
config: { filter: ((source: A) => boolean) | Store<boolean>; name?: string; greedy?: boolean; }

Returns

GuardResult<A>

Method for conditional event routing.

Type Parameters

optional
A = any
optional
S extends Source<A> = Source<A>
optional
F extends GuardFilterS<S> = GuardFilterS<S>

Parameters

source: S
config: { filter: F; name?: string; greedy?: boolean; }

Returns

GuardResult<GetGuardSource<S, F>>

Method for conditional event routing.

Type Parameters

S extends Source<unknown>
C extends Clock<unknown>
F extends IfUnknown<UnitValue<S>, Store<boolean> | ((clock: GetClock<C>) => boolean), IfUnknown<UnitValue<C>, Store<boolean> | ((source: GetSource<S>) => boolean), Store<boolean> | ((source: GetSource<S>, clock: GetClock<C>) => boolean)>>
T extends Target

Parameters

source: S
config: { clock?: C; filter: F; target: F extends (value: any, ...args: any) => value is infer X ? MultiTarget<T, X> : MultiTarget<T, GetGuardSource<S, F>>; name?: string; greedy?: boolean; }

Method for conditional event routing.

Type Parameters

S extends Source<unknown>
C extends Clock<unknown>
F extends IfUnknown<UnitValue<S>, Store<boolean> | ((clock: GetClock<C>) => boolean), IfUnknown<UnitValue<C>, Store<boolean> | ((source: GetSource<S>) => boolean), Store<boolean> | ((source: GetSource<S>, clock: GetClock<C>) => boolean)>>
T extends Target

Parameters

config: { source?: S; clock?: C; filter: F; target: F extends (value: any, ...args: any) => value is infer X ? MultiTarget<T, X> : MultiTarget<T, IfUnknown<UnitValue<S>, GetGuardClock<C, F>, GetGuardSource<S, F>>>; name?: string; greedy?: boolean; }