Skip to main content
zerotal

Documentation


Documentation / @zerotal/orm / index / RejectTransition

Type Alias: RejectTransition

RejectTransition = (reason) => never

Defined in: packages/orm/src/model/State.ts:37

Reject the in-flight transition with a human-readable reason. Throws a StateError pre-populated with the model name and the from/to states, so a guard doesn't have to construct the error itself:

guard: async (order, reject) => { if (!order.paid) reject("Can't ship an unpaid order."); }

Parameters

reason

string

Returns

never