Skip to content

Instantly share code, notes, and snippets.

@bborgesr
Last active March 14, 2019 15:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bborgesr/124c7d093aa02e4afee759353fbb92b3 to your computer and use it in GitHub Desktop.
Save bborgesr/124c7d093aa02e4afee759353fbb92b3 to your computer and use it in GitHub Desktop.
[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