Skip to content

Commit adc8894

Browse files
committed
some refactoring on README
1 parent 84aca68 commit adc8894

File tree

2 files changed

+13
-8
lines changed

2 files changed

+13
-8
lines changed

README.md

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,15 +36,9 @@ const AnotherTimerWithSameState = () => {
3636
};
3737
```
3838

39-
## 🔍 **Exported types**
40-
41-
```ts
42-
type ReactVariableHook<T> = (rerenderOnChange?: boolean) => T;
43-
```
44-
4539
## 📖 **API**
4640

47-
### <p align="center">createUseSharedVariable</p>
41+
### **1. createUseSharedVariable**
4842
#### Description
4943
Takes initial state as a parameter. Returns a hook can be imported and used anywhere in your application. When you use this hook, it returns you mutable global state. Whenever this state is changed component will be rerendered (this behaviour can be changed via *rerenderOnChange* flag in the hook).
5044

@@ -61,6 +55,17 @@ const useTimer = createUseSharedVariable({ ticks: 0 });
6155
export { useTimer }
6256
```
6357

58+
59+
## 🔍 **Exported types**
60+
61+
### **1. ReactVariableHook**
62+
#### Description
63+
Describes signature of a hook which returns *createUseSharedVariable* method.
64+
#### Signature
65+
```ts
66+
type ReactVariableHook<T> = (rerenderOnChange?: boolean) => T;
67+
```
68+
6469
## 💡 **Package usage example**
6570

6671
https://codesandbox.io/s/react-shared-variables-example-f7feo7

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@alevnyacow/shared-react-variables",
3-
"version": "1.0.3",
3+
"version": "1.0.4",
44
"description": "Easy and comfortable React state manager",
55
"main": "transpiled/index.js",
66
"scripts": {

0 commit comments

Comments
 (0)