You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
434 B
18 lines
434 B
import './grid.tag';
|
|
import './row.tag';
|
|
import './column.tag';
|
|
import unfold from 'ramda/src/unfold';
|
|
import take from 'ramda/src/take';
|
|
import drop from 'ramda/src/drop';
|
|
import length from 'ramda/src/length';
|
|
|
|
function chunk(n, xs) {
|
|
/* Chunk a list into groups of n size */
|
|
return unfold(
|
|
(xs) => {
|
|
if (length(xs) > 0) {
|
|
return [{"row" : take(n, xs)}, drop(n, xs)];
|
|
}
|
|
return false;
|
|
}, xs);
|
|
}
|
|
|