(actionToDispatch)
| 266 | } |
| 267 | |
| 268 | function action(actionToDispatch) { |
| 269 | if (process.env.NODE_ENV !== 'production') { |
| 270 | throwInvariant( |
| 271 | typeof actionToDispatch === 'object' && |
| 272 | actionToDispatch !== null && |
| 273 | typeof actionToDispatch.type !== 'undefined', |
| 274 | 'Cmd.action: first argument and only argument to Cmd.action must be an action' |
| 275 | ); |
| 276 | } |
| 277 | |
| 278 | return Object.freeze({ |
| 279 | [isCmdSymbol]: true, |
| 280 | type: cmdTypes.ACTION, |
| 281 | actionToDispatch, |
| 282 | simulate: simulateAction, |
| 283 | }); |
| 284 | } |
| 285 | |
| 286 | function clearTimeoutCmd(timerId) { |
| 287 | return run(clearTimeout, { args: [timerId] }); |
no test coverage detected