Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2020-09-29 | systic example for qemu, longer delaysystick | 1 | -1/+1 | ||
2020-09-29 | systic example for qemu | 1 | -1/+1 | ||
2020-09-29 | systic example for qemu | 1 | -2/+2 | ||
const contexts = new WeakMap(); const ID_PREFIX = 'r'; function getContext(rendererContextResult) { if (contexts.has(rendererContextResult)) { return contexts.get(rendererContextResult); } const ctx = { currentIndex: 0, get id() { return ID_PREFIX + this.currentIndex.toString(); }, }; contexts.set(rendererContextResult, ctx); return ctx; } export function incrementId(rendererContextResult) { const ctx = getContext(rendererContextResult); const id = ctx.id; ctx.currentIndex++; return id; }
aboutsummaryrefslogtreecommitdiff |
Age | Commit message (Collapse) | Author | Files | Lines | |
---|---|---|---|---|---|
2020-09-29 | systic example for qemu, longer delaysystick | 1 | -1/+1 | ||
2020-09-29 | systic example for qemu | 1 | -1/+1 | ||
2020-09-29 | systic example for qemu | 1 | -2/+2 | ||