mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
8 lines
178 B
TypeScript
8 lines
178 B
TypeScript
const ids: { [k: string]: number } = { main: 0 };
|
|
|
|
export const generateId = (type = "main") => {
|
|
const id = (ids[type] ?? 0) + 1;
|
|
ids[type] = id;
|
|
return id.toString();
|
|
};
|