2021-11-04 20:58:37 +01:00
|
|
|
class State {
|
|
|
|
|
constructor() {
|
|
|
|
|
this.states = new Map();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get(key) {
|
2021-11-05 14:28:01 +01:00
|
|
|
if (!this.states.has(key)) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
2021-11-04 20:58:37 +01:00
|
|
|
return this.states.get(key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set(key, value) {
|
|
|
|
|
return this.states.set(key, value);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default new State();
|