(
assignment:
| Assigner<LowInfer<TContext>, TExpressionEvent, TParams, TEvent, TActor>
| PropertyAssigner<
LowInfer<TContext>,
TExpressionEvent,
TParams,
TEvent,
TActor
>
)
| 136 | * update. |
| 137 | */ |
| 138 | export function assign< |
| 139 | TContext extends MachineContext, |
| 140 | TExpressionEvent extends AnyEventObject, // TODO: consider using a stricter `EventObject` here |
| 141 | TParams extends ParameterizedObject['params'] | undefined, |
| 142 | TEvent extends EventObject, |
| 143 | TActor extends ProvidedActor |
| 144 | >( |
| 145 | assignment: |
| 146 | | Assigner<LowInfer<TContext>, TExpressionEvent, TParams, TEvent, TActor> |
| 147 | | PropertyAssigner< |
| 148 | LowInfer<TContext>, |
| 149 | TExpressionEvent, |
| 150 | TParams, |
| 151 | TEvent, |
| 152 | TActor |
| 153 | > |
| 154 | ): ActionFunction< |
| 155 | TContext, |
| 156 | TExpressionEvent, |
| 157 | TEvent, |
| 158 | TParams, |
| 159 | TActor, |
| 160 | never, |
| 161 | never, |
| 162 | never, |
| 163 | never |
| 164 | > { |
| 165 | if (isDevelopment && executingCustomAction) { |
| 166 | console.warn( |
| 167 | 'Custom actions should not call `assign()` directly, as it is not imperative. See https://stately.ai/docs/actions#built-in-actions for more details.' |
| 168 | ); |
| 169 | } |
| 170 | |
| 171 | function assign( |
| 172 | _args: ActionArgs<TContext, TExpressionEvent, TEvent>, |
| 173 | _params: TParams |
| 174 | ) { |
| 175 | if (isDevelopment) { |
| 176 | throw new Error(`This isn't supposed to be called`); |
| 177 | } |
| 178 | } |
| 179 | |
| 180 | assign.type = 'xstate.assign'; |
| 181 | assign.assignment = assignment; |
| 182 | |
| 183 | assign.resolve = resolveAssign; |
| 184 | |
| 185 | return assign; |
| 186 | } |
no outgoing calls
searching dependent graphs…