(
actorScope: AnyActorScope,
snapshot: AnyMachineSnapshot,
args: ActionArgs<any, any, any>,
actionParams: ParameterizedObject['params'] | undefined,
{
collect
}: {
collect: CollectActions<
MachineContext,
EventObject,
ParameterizedObject['params'] | undefined,
EventObject,
ProvidedActor,
ParameterizedObject,
ParameterizedObject,
string,
EventObject
>;
}
)
| 112 | } |
| 113 | |
| 114 | function resolveEnqueueActions( |
| 115 | actorScope: AnyActorScope, |
| 116 | snapshot: AnyMachineSnapshot, |
| 117 | args: ActionArgs<any, any, any>, |
| 118 | actionParams: ParameterizedObject['params'] | undefined, |
| 119 | { |
| 120 | collect |
| 121 | }: { |
| 122 | collect: CollectActions< |
| 123 | MachineContext, |
| 124 | EventObject, |
| 125 | ParameterizedObject['params'] | undefined, |
| 126 | EventObject, |
| 127 | ProvidedActor, |
| 128 | ParameterizedObject, |
| 129 | ParameterizedObject, |
| 130 | string, |
| 131 | EventObject |
| 132 | >; |
| 133 | } |
| 134 | ): BuiltinActionResolution { |
| 135 | const actions: any[] = []; |
| 136 | const enqueue: Parameters<typeof collect>[0]['enqueue'] = function enqueue( |
| 137 | action |
| 138 | ) { |
| 139 | actions.push(action); |
| 140 | }; |
| 141 | enqueue.assign = (...args) => { |
| 142 | actions.push(assign(...args)); |
| 143 | }; |
| 144 | enqueue.cancel = (...args) => { |
| 145 | actions.push(cancel(...args)); |
| 146 | }; |
| 147 | enqueue.raise = (...args) => { |
| 148 | // for some reason it fails to infer `TDelay` from `...args` here and picks its default (`never`) |
| 149 | // then it fails to typecheck that because `...args` use `string` in place of `TDelay` |
| 150 | actions.push((raise as typeof enqueue.raise)(...args)); |
| 151 | }; |
| 152 | enqueue.sendTo = (...args) => { |
| 153 | // for some reason it fails to infer `TDelay` from `...args` here and picks its default (`never`) |
| 154 | // then it fails to typecheck that because `...args` use `string` in place of `TDelay |
| 155 | actions.push((sendTo as typeof enqueue.sendTo)(...args)); |
| 156 | }; |
| 157 | enqueue.sendParent = (...args) => { |
| 158 | actions.push((sendParent as typeof enqueue.sendParent)(...args)); |
| 159 | }; |
| 160 | enqueue.spawnChild = (...args) => { |
| 161 | actions.push(spawnChild(...args)); |
| 162 | }; |
| 163 | enqueue.stopChild = (...args) => { |
| 164 | actions.push(stopChild(...args)); |
| 165 | }; |
| 166 | enqueue.emit = (...args) => { |
| 167 | actions.push(emit(...args)); |
| 168 | }; |
| 169 | |
| 170 | collect( |
| 171 | { |
nothing calls this directly
no test coverage detected