File tree Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Expand file tree Collapse file tree 2 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " react-create-shared-state" ,
3
- "version" : " 0.2.0 " ,
3
+ "version" : " 0.2.2 " ,
4
4
"description" : " useState but with shared state across components" ,
5
5
"main" : " ./lib/index.js" ,
6
6
"types" : " ./lib/index.d.ts" ,
33
33
"scripts" : {
34
34
"test" : " jest" ,
35
35
"test:watch" : " npm run test -- --watch" ,
36
- "typecheck" : " tsc" ,
36
+ "typecheck" : " tsc --noemit " ,
37
37
"clean" : " del-cli lib" ,
38
38
"build:declarations" : " tsc --emitDeclarationOnly -p tsconfig.build.json --outDir lib" ,
39
39
"build:compile" : " babel src --out-dir lib --extensions \" .ts\" --ignore \" **/*.test.ts\" " ,
Original file line number Diff line number Diff line change @@ -16,7 +16,9 @@ export function createSharedState<ValueType>(defaultValue: ValueType) {
16
16
17
17
useEffect ( ( ) => {
18
18
listeners . add ( setValue ) ;
19
- return ( ) => listeners . delete ( setValue ) ;
19
+ return ( ) => {
20
+ listeners . delete ( setValue ) ;
21
+ } ;
20
22
} , [ ] ) ;
21
23
22
24
return [ value , setValue ] ;
You can’t perform that action at this time.
0 commit comments