UNPKG

@nozbe/watermelondb

Version:

Build powerful React Native and React web apps that scale from hundreds to tens of thousands of records and remain fast

12 lines (10 loc) 257 B
// @flow export default function splitEvery<T>(n: number, list: T[]): T[][] { const splitted = [] let position = 0 const { length } = list while (position < length) { splitted.push(list.slice(position, (position += n))) } return splitted }