Files
2020-12-07 09:31:33 -07:00

8 lines
180 B
TypeScript

const ids: { [key: string]: number } = { main: 0 };
export const generateId = (type = 'main') => {
const id = (ids[type] ?? 0) + 1;
ids[type] = id;
return id.toString();
};