Skip to content

Commit 32dc50a

Browse files
committed
Update Readme
1 parent 312af41 commit 32dc50a

File tree

2 files changed

+9
-16
lines changed

2 files changed

+9
-16
lines changed

README.md

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -185,19 +185,19 @@ export default App;
185185

186186
### Fifth step: Using your signals.
187187

188-
Create a component called `Counter` inside the Counter.js file. Then import two hooks from `gx` called `useSignal` and `useAction` like follow.
188+
Create a component called `Counter` inside the Counter.js file. Then import two hooks from `gx` called `useSignal` and `useActions` like follow.
189189

190190

191191
```js
192192
import React from "react";
193-
import { useSignal, useAction } from "@dilane3/gx";
193+
import { useSignal, useActions } from "@dilane3/gx";
194194

195195
function Counter() {
196196
// State
197197
const counter = useSignal("counter");
198198

199199
// Actions
200-
const { increment, decrement } = useAction("counter");
200+
const { increment, decrement } = useActions("counter");
201201

202202
return (
203203
<div>
@@ -279,30 +279,23 @@ This hook takes the name of the signal as a parameter and returns the state cont
279279
const counter = useSignal("counter");
280280
```
281281

282-
### `useAction`
282+
### `useActions`
283283

284284
This hook takes the name of the signal as a the first parameter and returns an object that contains all the actions of this signal.
285285

286286
```js
287-
const { increment, decrement } = useAction("counter");
287+
const { increment, decrement } = useActions("counter");
288288
```
289289

290-
**`New in version 1.1.0`**
291-
292-
Note that, the `useAction` hook can accept a second parameter which is the list of actions that you want to use. If you don't specify the second parameter, all the actions of the signal will be returned.
290+
### `useAction`
293291

294-
There is another thing that you have to know.
295-
If you provide only one action as a second parameter, the hook will return only the action itself and not an object that contains the action.
292+
This hook takes the name of the signal as the first parameter and the name of the action as the second one and then return that action.
296293

297294
```js
298295
const increment = useAction("counter", "increment");
299296
```
300297

301-
And if you provide more than one action, the hook will return an object that contains all the actions provided.
302-
303-
```js
304-
const { increment, decrement } = useAction("counter", "increment", "decrement");
305-
```
298+
See more on the [documentation](https://gx.dilane3.com/docs/guide/hooks/useAction)
306299

307300
## TypeScript Support
308301

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dilane3/gx",
3-
"version": "1.2.0",
3+
"version": "1.2.1",
44
"private": false,
55
"license": "MIT",
66
"main": "dist/index.js",

0 commit comments

Comments
 (0)