Skip to content

Commit 7f3741e

Browse files
committed
<style> element generated - issues: performance - have to move the init into the tooltip constructor
1 parent 742513c commit 7f3741e

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/utils/idGenerator.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
const idLen = 20;
2+
const styleId = Math.round((Math.pow(36, idLen + 1) - Math.random() * Math.pow(36, idLen))).toString(36).slice(1); // TODO: gotta make it so there are only letters, no numbers
3+
4+
class IdGenerator {
5+
6+
static get styleId() {
7+
return styleId;
8+
}
9+
10+
static generateInternalTooltipUID() {
11+
return Math.round((Math.pow(36, idLen + 1) - Math.random() * Math.pow(36, idLen))).toString(36).slice(1); // TODO: gotta make it so there are only letters, no numbers
12+
}
13+
}
14+
15+
export default IdGenerator;

0 commit comments

Comments
 (0)