From f941dbbdddd765e44eb0aa789fda88631e943a65 Mon Sep 17 00:00:00 2001 From: Max Isom Date: Sat, 24 Oct 2020 14:27:02 -0400 Subject: Fix setup wizard when there's >20 channels --- src/utils/arrays.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/utils/arrays.ts (limited to 'src/utils') 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 = (arr: T[], len: number) => { + const chunks = []; + + let i = 0; + while (i < arr.length) { + chunks.push(arr.slice(i, i += len)); + } + + return chunks; +}; -- cgit v1.2.3