({ cmds, batch = false }, context)
| 71 | } |
| 72 | |
| 73 | function handleParallelList({ cmds, batch = false }, context) { |
| 74 | const promises = cmds |
| 75 | .map((nestedCmd) => { |
| 76 | const possiblePromise = executeCmdInternal(nestedCmd, context); |
| 77 | if (!possiblePromise || batch) { |
| 78 | return possiblePromise; |
| 79 | } |
| 80 | |
| 81 | return possiblePromise.then((result) => { |
| 82 | return Promise.all(result.map((a) => context.wrappedDispatch(a))); |
| 83 | }); |
| 84 | }) |
| 85 | .filter((x) => x); |
| 86 | |
| 87 | if (promises.length === 0) { |
| 88 | return null; |
| 89 | } |
| 90 | |
| 91 | return Promise.all(promises) |
| 92 | .then(flatten) |
| 93 | .then((actions) => { |
| 94 | return batch ? actions : []; |
| 95 | }); |
| 96 | } |
| 97 | |
| 98 | function handleSequenceList({ cmds, batch = false }, context) { |
| 99 | const firstCmd = cmds.length ? cmds[0] : null; |
no test coverage detected