Created
July 11, 2017 20:49
-
-
Save elliotec/ee62b1008250eb138d0807e3d9ed88b4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const itemsById = itemsWithFields.reduce( | |
(accum, item) => { | |
const itemId = item.sys.id; | |
accum[itemId] = item; | |
return accum; | |
}, [] | |
); | |
console.log(itemsById); | |
return { | |
...state, | |
devices: itemsById, | |
isFetching: false, | |
contentful: action.contentful, | |
lastUpdated: action.receivedAt | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment