speedclimbing/website

View on GitHub
src/utils/uniqueId.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { get } from 'svelte/store';
import { nextId } from '../stores';

export function uniqueId() {
    const id = get(nextId);
    nextId.set(id + 1);
    return `uid-${id}`;
}