Files
eewing cf73cd3b4c INIT
2026-02-17 14:10:16 -06:00

9 lines
248 B
JavaScript

globalThis.bitsIdCounter ??= { current: 0 };
/**
* Generates a unique ID based on a global counter.
*/
export function useId(prefix = "bits") {
globalThis.bitsIdCounter.current++;
return `${prefix}-${globalThis.bitsIdCounter.current}`;
}