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 56df2bbCopy full SHA for 56df2bb
packages/base/src/stores/StyleStore.ts
@@ -39,9 +39,13 @@ 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 index = listeners.findIndex((l) => l === listener);
46
+ if (index >= 0) {
47
+ listeners.splice(index, 1);
48
+ }
49
};
50
}
51
0 commit comments