Last active
December 3, 2018 00:00
-
-
Save ItsJonQ/bc8135f624b6e9b0c2d8778a390f69e1 to your computer and use it in GitHub Desktop.
Creates a unique incrementing ID with a prefix
This file contains 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
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