We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 149cb11 commit 4aaf4f9Copy full SHA for 4aaf4f9
packages/base/src/stores/StyleStore.ts
@@ -39,9 +39,14 @@ function getSnapshot(): IStyleStore {
39
40
function subscribe(listener: () => void) {
41
const listeners = getListeners();
42
- STORE_LOCATION[getStyleStoreListenersSymbol()] = [...listeners, listener];
+ listeners.push(listener);
43
+
44
return () => {
- STORE_LOCATION[getStyleStoreListenersSymbol()] = listeners.filter((l) => l !== listener);
45
+ const updatedListeners = getListeners();
46
+ const index = updatedListeners.indexOf(listener);
47
+ if (index !== -1) {
48
+ updatedListeners.splice(index, 1);
49
+ }
50
};
51
}
52
0 commit comments