File tree Expand file tree Collapse file tree 3 files changed +5
-11
lines changed
Expand file tree Collapse file tree 3 files changed +5
-11
lines changed Original file line number Diff line number Diff line change @@ -14,20 +14,14 @@ Shared React variables provide you easy and comfortable mutable state management
1414## 🔍 ** Example**
1515
1616``` tsx
17- const [
18- // returns a mutable object
19- useTimer,
20- // use it to rewrite the whole object,
21- // you don't need it usually
22- useTimerRewrite
23- ] = createUseSharedVariable ({ ticks: 0 });
17+ import { createUseSharedVariable } from " @alevnyacow/shared-react-variables" ;
18+
19+ const [useTimer] = createUseSharedVariable ({ ticks: 0 });
2420
2521const Timer = () => {
26- // using shared react variable
2722 const timer = useTimer ();
2823 useEffect (() => {
2924 setInterval (() => {
30- // object is mutable
3125 timer .ticks ++ ;
3226 }, 1000 );
3327 }, []);
Original file line number Diff line number Diff line change 11{
22 "name" : " @alevnyacow/shared-react-variables" ,
3- "version" : " 2.0.1 " ,
3+ "version" : " 2.0.2 " ,
44 "description" : " Easy and comfortable React state manager" ,
55 "main" : " transpiled/index.js" ,
66 "scripts" : {
Original file line number Diff line number Diff line change 33 "version" : " 0.1.0" ,
44 "private" : true ,
55 "dependencies" : {
6- "@alevnyacow/shared-react-variables" : " file:../../alevnyacow-shared-react-variables-2.0.1 .tgz" ,
6+ "@alevnyacow/shared-react-variables" : " file:../../alevnyacow-shared-react-variables-2.0.2 .tgz" ,
77 "@testing-library/jest-dom" : " ^5.16.2" ,
88 "@testing-library/react" : " ^12.1.4" ,
99 "@testing-library/user-event" : " ^13.5.0" ,
You can’t perform that action at this time.
0 commit comments