Интегрирован wesp в сайт
CI / quality (push) Canceled after 0s

This commit is contained in:
влад
2026-07-17 12:57:18 +03:00
parent 5dfa06ddbe
commit 355c0ef9f1
883 changed files with 194576 additions and 177 deletions
+26
View File
@@ -0,0 +1,26 @@
export class AppState {
constructor(initialState = {}) {
this._state = { ...initialState };
this._listeners = new Set();
}
get(key) {
return this._state[key];
}
getAll() {
return { ...this._state };
}
set(patch) {
this._state = { ...this._state, ...patch };
for (const listener of this._listeners) {
listener(this.getAll());
}
}
subscribe(listener) {
this._listeners.add(listener);
return () => this._listeners.delete(listener);
}
}