Skip to content

Commit 6d47496

Browse files
committed
stale reference...
1 parent b484881 commit 6d47496

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/base/src/stores/StyleStore.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,10 @@ function subscribe(listener: () => void) {
4242
listeners.push(listener);
4343

4444
return () => {
45-
const index = listeners.indexOf(listener);
45+
const updatedListeners = getListeners();
46+
const index = updatedListeners.indexOf(listener);
4647
if (index !== -1) {
47-
listeners.splice(index, 1);
48+
updatedListeners.splice(index, 1);
4849
}
4950
};
5051
}

0 commit comments

Comments
 (0)