@@ -16,6 +16,15 @@ const mkExecNextMessage = (values, fn, resolve, chunkSize, msg) => function exec
const createSplitMessage = () => `FOR_EACH_SPLIT_${Math.floor(Math.random() * 10000)}`;
+/**
+ * Splits an array into chunks and breaks the execution queue to ensure reactivity.
+ *
+ * @memberOf array
+ * @param {Array} ar
+ * @param {function} fn
+ * @param {number} chunkSize
+ * @return {Promise}
+ */
const chunkedForEach = (ar = [], fn = Function.prototype, chunkSize = 1) => {
checkArray(ar);
if (!$postMessage) { throw Error('postMessage not available'); }