Rxova
Skip to content

Type Alias: JourneyRuntimeOptions<TPlugins, TStepId>

@rxova/journey-react


@rxova/journey-react / JourneyRuntimeOptions

type JourneyRuntimeOptions<TPlugins, TStepId> = object;

Defined in: core/src/core/types.ts:568

Runtime options shared by linear and graph journeys.

Type ParameterDefault type
TPlugins extends readonly AnyJourneyPlugin[]readonly []
TStepId extends stringstring
optional autoStart?: boolean;

Defined in: core/src/core/types.ts:591

Defaults to true: creating a journey starts it, so the common case needs no second call.

The trade this makes, stated plainly because it cannot be worked around: starting happens inside the constructor and the initial entry commits synchronously, so the first stepEnter has already fired by the time the factory returns. A subscriber attached afterwards cannot see it.

Pass false when that first event matters — it is the subscribe-then-start order, and saying so out loud is better than a default that silently assumes it:

const machine = createLinearJourney(definition, { autoStart: false });
machine.subscriptions.subscribeEvent("stepEnter", onEnter);
machine.controls.start();

optional defaultTimeoutMs?: number;

Defined in: core/src/core/types.ts:608

Applied to navigation work and every async hook invocation. Work timeouts block movement; post-commit hook timeouts surface as step errors.


optional onListenerError?: (error) => void;

Defined in: core/src/core/types.ts:614

Called when a subscriber (selector or event listener) throws. Listener failures are always isolated — this hook only routes the report. Defaults to a console.error; a throwing reporter falls back to that default.

ParameterType
errorunknown

void


optional persist?: JourneyPersistOption;

Defined in: core/src/core/types.ts:603

Expands into the persistence plugin, prepended to plugins. Combining it with an explicit persistence plugin fails as a duplicate plugin name.


optional plugins?: TPlugins;

Defined in: core/src/core/types.ts:615


optional startAt?: TStepId;

Defined in: core/src/core/types.ts:598

Start (and restart) directly at this step instead of the first/initial one: only the target’s onEnter fires, earlier steps are neither entered nor visited, and the timeline begins as [startAt]. An unknown id throws at creation.