@logixjs/react
    Preparing search index...

    Interface ModuleRef<S, A, Tags, Def, Dispatchers>

    interface ModuleRef<
        S,
        A,
        Tags extends string = ActionTags<A>,
        Def = unknown,
        Dispatchers = ModuleDispatchers<A, Tags, Def>,
    > {
        actions: ModuleActions<A, Tags>;
        actions$: Stream<A, never, never>;
        changes: <V>(selector: (s: S) => V) => Stream<V>;
        def?: Def;
        dispatch: Dispatch<A>;
        dispatchers: Dispatchers;
        getState: Effect<S, never, never>;
        imports: ModuleImports;
        ref: <V = S>(selector?: (s: S) => V) => SubscriptionRef<V>;
        runtime: ModuleRuntime<S, A>;
        setState: (next: S) => Effect<void>;
    }

    Type Parameters

    Index

    Properties

    actions: ModuleActions<A, Tags>
    actions$: Stream<A, never, never>
    changes: <V>(selector: (s: S) => V) => Stream<V>
    def?: Def

    Definition anchor (typically a ModuleTag) for reflecting actions/reducers/source and other metadata.

    • DX: when runtime.actions.* can't jump to source, use ref.def?.reducers?.xxx / ref.def?.actions.xxx to locate definitions quickly.
    dispatch: Dispatch<A>
    dispatchers: Dispatchers
    getState: Effect<S, never, never>
    imports: ModuleImports

    Fractal module imports sugar:

    • host.imports.get(ChildModule) resolves a child module instance within the host instance scope.
    • strict by default: throws when scope is missing, avoiding accidentally routing to a global instance.
    ref: <V = S>(selector?: (s: S) => V) => SubscriptionRef<V>
    runtime: ModuleRuntime<S, A>
    setState: (next: S) => Effect<void>