Function: createGraphJourney()
@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 Parameters
Section titled “Type Parameters”| Type Parameter | Default type |
|---|---|
TContext | - |
TStepId extends string | - |
TEvents extends JourneyEventObject | JourneyEventObject |
THandlers | unknown |
TMeta | Record<string, unknown> |
TPlugins extends readonly AnyJourneyPlugin[] | readonly [] |
TTerminationPayloads extends JourneyTerminationPayloads | JourneyTerminationPayloads |
Parameters
Section titled “Parameters”| Parameter | Type |
|---|---|
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.context | TContext |
definition.handlers? | THandlers |
definition.initial | NoInfer<TStepId> |
definition.steps | Readonly<Record<TStepId, GraphStepConfig<NoInfer<TContext>, NoInfer<TStepId>, NoInfer<TEvents>, TMeta, NoInfer<THandlers>>>> |
options | GraphJourneyOptions<NoInfer<THandlers>, TPlugins, NoInfer<TStepId>> |
Returns
Section titled “Returns”GraphJourneyMachine<TContext, TStepId, TEvents, TMeta, TPlugins, CompletePayloadOf<TTerminationPayloads>, TerminatePayloadOf<TTerminationPayloads>>