UNPKG
@playwire/pw-react-component
Version:
latest (1.0.9)
1.0.9
1.0.8
1.0.7
1.0.6
1.0.5
1.0.4
1.0.3
1.0.2
1.0.1
Playwire React Component
github.com/intergi/pw-react-component
intergi/pw-react-component
@playwire/pw-react-component
/
src
/
lib
/
store.js
16 lines
(13 loc)
•
329 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class
Store
{ units = {}; getUnitId =
(
unit
) =>
{
if
(
typeof
this
.
units
[unit] ===
'undefined'
) {
this
.
units
[unit] =
1
;
return
`pw-
${unit}
`
; }
else
{ ++
this
.
units
[unit];
return
`pw-
${unit}
${
this
.units[unit]}
`
} } };
export
default
new
Store
();