Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
[Make a CMS card's id unique] Reusing existing code, and keeping in mind that it's preferrable to destructure the object rather than mutate the id in place. #cms
try {
const card = buildCard(
card,
data,
filtersAndFormatters,
Object.assign({}, settingsAndOptions, { cardIndex })
);
return {...card, id: `${card.id}:${cardIndex}`};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment