mirror of
https://github.com/ruisaraiva19/favycon.git
synced 2026-09-12 19:51:07 +05:00
* feat: add dark mode toggle component Add dark mode toggle component with custom hook fix #14 * feat(dark-mode): add svgs, fix flash and css modules support * docs: update get start guide and fix typos
15 lines
265 B
TypeScript
15 lines
265 B
TypeScript
const idCounter: { [key: string]: number } = {}
|
|
|
|
export const uniqueId = (prefix = '$unique$') => {
|
|
if (!idCounter[prefix]) {
|
|
idCounter[prefix] = 0
|
|
}
|
|
|
|
const id = ++idCounter[prefix]
|
|
if (prefix === '$unique$') {
|
|
return `${id}`
|
|
}
|
|
|
|
return `${prefix}${id}`
|
|
}
|