Skip to content

Instantly share code, notes, and snippets.

@ItsJonQ
Last active December 3, 2018 00:00
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 ItsJonQ/bc8135f624b6e9b0c2d8778a390f69e1 to your computer and use it in GitHub Desktop.
Save ItsJonQ/bc8135f624b6e9b0c2d8778a390f69e1 to your computer and use it in GitHub Desktop.
Creates a unique incrementing ID with a prefix
export function createUniqueIDFactory(prefix) {
let index = 1
return `${prefix}${index++}`
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment