Skip to content

Commit 83ebff1

Browse files
Merge pull request #28 from HichemTab-tech/fix-subsriber-return-type
fix: update return type of subscribe method in SharedValuesManager toa function
2 parents 307f493 + c860983 commit 83ebff1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
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": "1.0.15",
3+
"version": "1.0.16",
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: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ export class SharedValuesApi<T extends SharedValue, V, R = T> {
283283
return all;
284284
}
285285

286-
subscribe<S extends string = string>(sharedCreated: SharedCreated, listener: AFunction): void;
286+
subscribe<S extends string = string>(sharedCreated: SharedCreated, listener: AFunction): () => void;
287287
subscribe<S extends string = string>(key: S | SharedCreated, listener: AFunction, scopeName?: Prefix) {
288288
let keyStr!: string;
289289
let prefixStr!: string;

0 commit comments

Comments
 (0)