export function partitionWithThreshold()

in packages/rc-components/rc-actions/src/utils.tsx [123:134]


export function partitionWithThreshold<T>(arr: T[], threshold: number) {
  const front: T[] = []
  const back: T[] = []
  arr.forEach((item, i) => {
    if (i < threshold) {
      front.push(item)
    } else {
      back.push(item)
    }
  })
  return [front, back] as [T[], T[]]
}