Skip to content

Commit a90d105

Browse files
fix: bump version to 2.1.7-beta & debugging
1 parent 226a0f2 commit a90d105

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-shared-states",
3-
"version": "2.1.6-beta",
3+
"version": "2.1.7-beta",
44
"type": "module",
55
"description": "Global state made as simple as useState, with zero config, built-in async caching, and automatic scoping.",
66
"keywords": [

src/SharedValuesManager.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -154,11 +154,11 @@ export class SharedValuesManager<T> {
154154
unsub?.();
155155
log(`[${SharedValuesManager.prefix(key, prefix)}]`, "unmount effect");
156156
const entry = this.get(key, prefix);
157-
if (entry && entry.listeners?.length === 0) {
157+
if (entry && entry.listeners?.length === 0 && !entry.isStatic) {
158158
this.clear(key, prefix);
159159
}
160160
}
161-
}, []);
161+
}, [key, prefix]);
162162
}
163163
}
164164

0 commit comments

Comments
 (0)