Review feedback on supporting multiple relatives in node-grid columns

This commit is contained in:
Simon Howe
2017-07-04 10:41:41 +02:00
parent ffd531e44a
commit ee55d17b0e
2 changed files with 15 additions and 7 deletions
+9
View File
@@ -28,5 +28,14 @@ export function moveElement(array, from, to) {
}
export function intersperse(items, value) {
//
// intersperse([1, 2, 3], 'a') => [1, 'a', 2, 'a', 3]
//
// Useful for when you wanna do: [<MyReactListItem />, <MyReactListItem />].join(' ')
// But you can't because React Components aren't strings.
//
// intersperse([<MyReactListItem />, <MyReactListItem />], ' ')
// Will get you there!
//
return [].concat(...items.map(e => [value, e])).slice(1);
}