Module

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

Business logic with ease ☄️
Latest
class Domain
implements Unit<any>
import { Domain } from "https://dotland.deno.dev/x/effector@effector-vue%4023.1.0/packages/effector/index.d.ts";

A way to group and process events, stores and effects. Useful for logging and assigning a reset trigger to many effects. Domain is notified via onCreateEvent, onCreateStore, onCreateEffect, onCreateDomain methods when events, stores, effects, or nested domains are created

Properties

readonly
__: any
compositeName: CompositeName
history: { domains: Set<Domain>; stores: Set<StoreWritable<any>>; effects: Set<Effect<any, any, any>>; events: Set<EventCallable<any>>; }
readonly
kind: kind
shortName: string
sid: string | null

Methods

createDomain(name?: string): Domain
createEffect<FN extends Function>(handler: FN): EffectByHandler<FN, Error>
createEffect<Params, Done, Fail = Error>(handler: (params: Params) => Done | Promise<Done>): Effect<Params, Done, Fail>
createEffect<FN extends Function, Fail>(handler: FN): EffectByHandler<FN, Fail>
createEffect<FN extends Function>(config: { name?: string; handler: FN; sid?: string; }): EffectByHandler<FN, Error>
createEffect<Params, Done, Fail = Error>(name?: string, config?: { handler?: (params: Params) => Promise<Done> | Done; sid?: string; }): Effect<Params, Done, Fail>
createEffect<Params, Done, Fail = Error>(config: { handler?: (params: Params) => Promise<Done> | Done; sid?: string; name?: string; }): Effect<Params, Done, Fail>
createEvent<Payload = void>(name?: string): EventCallable<Payload>
createEvent<Payload = void>(config: { name?: string; sid?: string; }): EventCallable<Payload>
createStore<State, SerializedState extends Json = Json>(defaultState: State, config?: { name?: string; sid?: string; updateFilter?: (update: State, current: State) => boolean; serialize?: "ignore" | { write: (state: State) => SerializedState; read: (json: SerializedState) => State; }; }): StoreWritable<State>
domain(name?: string): Domain
effect<FN extends Function>(handler: FN): EffectByHandler<FN, Error>
effect<Params, Done, Fail = Error>(handler: (params: Params) => Done | Promise<Done>): Effect<Params, Done, Fail>
effect<FN extends Function, Fail>(handler: FN): EffectByHandler<FN, Fail>
effect<Params, Done, Fail = Error>(name?: string, config?: { handler?: (params: Params) => Promise<Done> | Done; sid?: string; }): Effect<Params, Done, Fail>
effect<Params, Done, Fail = Error>(config: { handler?: (params: Params) => Promise<Done> | Done; sid?: string; name?: string; }): Effect<Params, Done, Fail>
event<Payload = void>(name?: string): EventCallable<Payload>
event<Payload = void>(config: { name?: string; sid?: string; }): EventCallable<Payload>
getType(): string
onCreateDomain(hook: (newDomain: Domain) => any): Subscription
onCreateEffect(hook: (newEffect: Effect<unknown, unknown, unknown>) => any): Subscription
onCreateEvent(hook: (newEvent: EventCallable<unknown>) => any): Subscription
onCreateStore(hook: (newStore: InternalStore<unknown>) => any): Subscription
store<State, SerializedState extends Json = Json>(defaultState: State, config?: { name?: string; sid?: string; updateFilter?: (update: State, current: State) => boolean; serialize?: "ignore" | { write: (state: State) => SerializedState; read: (json: SerializedState) => State; }; }): StoreWritable<State>