@oruga-ui/oruga-next
Version:
UI components for Vue.js and CSS framework agnostic
18 lines (15 loc) • 369 B
text/typescript
/** create a unique id sequence */
export function useSequentialId(start: number = 0): {
nextSequence: () => string;
sequence: Readonly<number>;
} {
let sequence = start;
/** increase the unique id sequence */
function nextSequence(): string {
return String(sequence++);
}
return {
nextSequence,
sequence,
};
}