aboutsummaryrefslogtreecommitdiff
path: root/src/utils
diff options
context:
space:
mode:
authorMax Isom <[email protected]>2020-10-24 14:27:02 -0400
committerMax Isom <[email protected]>2020-10-24 14:27:02 -0400
commitf941dbbdddd765e44eb0aa789fda88631e943a65 (patch)
tree75b5df304e370d88436d756984ad6c2d3ea92671 /src/utils
parent30c80683638c76607e5eaf3d2dfb1be0c8534d82 (diff)
downloadmuse-f941dbbdddd765e44eb0aa789fda88631e943a65.tar.xz
muse-f941dbbdddd765e44eb0aa789fda88631e943a65.zip
Fix setup wizard when there's >20 channels
Diffstat (limited to 'src/utils')
-rw-r--r--src/utils/arrays.ts10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/arrays.ts b/src/utils/arrays.ts
new file mode 100644
index 0000000..3961244
--- /dev/null
+++ b/src/utils/arrays.ts
@@ -0,0 +1,10 @@
+export const chunk = <T>(arr: T[], len: number) => {
+ const chunks = [];
+
+ let i = 0;
+ while (i < arr.length) {
+ chunks.push(arr.slice(i, i += len));
+ }
+
+ return chunks;
+};