Rxova
Skip to content

Function: createGraphJourney()

@rxova/journey-core


@rxova/journey-core / createGraphJourney

function createGraphJourney<TContext, TStepId, TEvents, THandlers, TMeta, TPlugins, TTerminationPayloads>(definition, options?): GraphJourneyMachine<TContext, TStepId, TEvents, TMeta, TPlugins, CompletePayloadOf<TTerminationPayloads>, TerminatePayloadOf<TTerminationPayloads>>;

Defined in: packages/core/src/graph/graph.ts:173

Creates a graph journey runtime from a pure-data definition.

send(event, payload?) is the primary verb; goToStepById is transition-gated sugar (fires only if an enabled transition targets that id). Timeline moves bypass transition gating — retracing a walked path is always legal. Step onLeave effects still run after those moves commit.

Type ParameterDefault type
TContext-
TStepId extends string-
TEvents extends JourneyEventObjectJourneyEventObject
THandlersunknown
TMetaRecord<string, unknown>
TPlugins extends readonly AnyJourneyPlugin[]readonly []
TTerminationPayloads extends JourneyTerminationPayloadsJourneyTerminationPayloads
ParameterType
definition{ $events?: TEvents; $payloads?: TTerminationPayloads; context: TContext; handlers?: THandlers; initial: NoInfer<TStepId>; steps: Readonly<Record<TStepId, GraphStepConfig<NoInfer<TContext>, NoInfer<TStepId>, NoInfer<TEvents>, TMeta, NoInfer<THandlers>>>>; }
definition.$events?TEvents
definition.$payloads?TTerminationPayloads
definition.contextTContext
definition.handlers?THandlers
definition.initialNoInfer<TStepId>
definition.stepsReadonly<Record<TStepId, GraphStepConfig<NoInfer<TContext>, NoInfer<TStepId>, NoInfer<TEvents>, TMeta, NoInfer<THandlers>>>>
optionsGraphJourneyOptions<NoInfer<THandlers>, TPlugins, NoInfer<TStepId>>

GraphJourneyMachine<TContext, TStepId, TEvents, TMeta, TPlugins, CompletePayloadOf<TTerminationPayloads>, TerminatePayloadOf<TTerminationPayloads>>