Add Genres as "Chips" in Album details and Song details
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
export * from './baseUrl'
|
||||
export * from './docsUrl'
|
||||
export * from './formatters'
|
||||
export * from './intersperse'
|
||||
export * from './notifications'
|
||||
export * from './openInNewTab'
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
/* intersperse: Return an array with the separator interspersed between
|
||||
* each element of the input array.
|
||||
*
|
||||
* > _([1,2,3]).intersperse(0)
|
||||
* [1,0,2,0,3]
|
||||
*
|
||||
* From: https://stackoverflow.com/a/23619085
|
||||
*/
|
||||
export const intersperse = (arr, sep) => {
|
||||
if (arr.length === 0) {
|
||||
return []
|
||||
}
|
||||
|
||||
return arr.slice(1).reduce(
|
||||
function (xs, x, i) {
|
||||
return xs.concat([sep, x])
|
||||
},
|
||||
[arr[0]]
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user