(cmds, options = {})
| 365 | } |
| 366 | |
| 367 | function list(cmds, options = {}) { |
| 368 | if (process.env.NODE_ENV !== 'production') { |
| 369 | if (!options.testInvariants) { |
| 370 | throwInvariant( |
| 371 | Array.isArray(cmds) && cmds.every(isCmd), |
| 372 | 'Cmd.list: first argument to Cmd.list must be an array of other Cmds' |
| 373 | ); |
| 374 | |
| 375 | throwInvariant( |
| 376 | typeof options === 'object', |
| 377 | 'Cmd.list: second argument to Cmd.list must be an options object' |
| 378 | ); |
| 379 | } |
| 380 | } else if (options.testInvariants) { |
| 381 | throw Error( |
| 382 | "Redux Loop: Detected usage of Cmd.list's testInvariants option in production code. This should only be used in tests." |
| 383 | ); |
| 384 | } |
| 385 | |
| 386 | const { testInvariants, ...rest } = options; |
| 387 | |
| 388 | return Object.freeze({ |
| 389 | [isCmdSymbol]: true, |
| 390 | type: cmdTypes.LIST, |
| 391 | cmds, |
| 392 | simulate: simulateList, |
| 393 | ...rest, |
| 394 | }); |
| 395 | } |
| 396 | |
| 397 | function simulateMap(simulation) { |
| 398 | let result = this.nestedCmd.simulate(simulation); |
no test coverage detected