mirror of
https://github.com/marko-js/marko.git
synced 2025-12-08 19:26:05 +00:00
17 lines
357 B
JavaScript
17 lines
357 B
JavaScript
var KEY = Symbol();
|
|
|
|
function UniqueId(out) {
|
|
this.prefix = out.global.widgetIdPrefix || 'w';
|
|
this.nextId = 0;
|
|
}
|
|
|
|
function nextWidgetId(out) {
|
|
var global = out.global;
|
|
|
|
var idProvider = global[KEY] ||
|
|
(global[KEY] = new UniqueId(out));
|
|
|
|
return idProvider.prefix + (idProvider.nextId++);
|
|
}
|
|
|
|
exports.$__nextWidgetId = nextWidgetId; |