MCPcopy
hub / github.com/redux-loop/redux-loop / list

Function list

src/cmd.js:367–395  ·  view source on GitHub ↗
(cmds, options = {})

Source from the content-addressed store, hash-verified

365}
366
367function 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
397function simulateMap(simulation) {
398 let result = this.nestedCmd.simulate(simulation);

Callers 1

handleSequenceListFunction · 0.85

Calls 1

throwInvariantFunction · 0.90

Tested by

no test coverage detected