Skip to content

Commit

Permalink
doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben-Arushanyan committed Apr 13, 2021
1 parent b8483e0 commit 6854734
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 29 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ console.log(type2)

```

As we see in the example above, every action object have following fields:
As we see in the example above, every action object has following fields:
- **`type`** \<String> action type as a string
- **`args`** \<Array> any array that contains all the data needed for the action
- **`cb`** \<Function> callback function by default is *identity function (x => x)*, but we can pass any function if we need to have a callback, The next example below shows how to pass that.
- **`_index`** \<Integer> positive integer number (1, 2, 3, ...)․ It creates automatically and shows action order by index. can be used as a unique identifier or help understand which action created earlier(in rare cases, it may be necessary)
- **`cb`** \<Function> callback function by default is *identity function (x => x)*, but we can pass any function if we need to have a callback. The next example below shows how to pass that.
- **`_index`** \<Integer> positive integer number (1, 2, 3, ...)․ It is created automatically and shows action order by index. It can be used as a unique identifier or help understand which action was created earlier(in rare cases, it may be necessary)


<hr/>

## Actions With Callback

Sometimes we need, which action has a **callback capability**, In lots of cases it can be very necessary․ \
Sometimes we need the action to have **callback capability**. It might be necessary in many cases. \
**`Actions Creator`** allows us to do this in a beautiful way: \
when we try to generate an action object, we can pass the **callback function** as the last argument, `Actions Creator` will check if the last argument is a function, it will be considered as a **callback function**.
When we try to generate an action object, we can pass the **callback function** as the last argument. `Actions Creator` will check and if the last argument is a function, it will be considered as a **callback function**.

```javascript
import actionsCreator from "actions-creator"
Expand All @@ -93,7 +93,7 @@ callbackable_action.cb()
<hr/>

## Customize
We do not recommend customize,
We do not recommend to customize,
but if you need to do it, you can easily do that: \
see: [Produce By Path Pattern](https://github.com/ruben-arushanyan/produce-by-path)
<hr/>
Expand Down
40 changes: 20 additions & 20 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "actions-creator",
"version": "1.0.1",
"description": "\"Actions Creator\" is an awesome tiny javascript package that allows you to dynamically and easily create \"callbackable-actions\" standardized objects.",
"version": "1.0.2",
"description": "Actions Creator is an awesome tiny javascript package that allows you to dynamically and easily create callbackable-actions standardized objects.",
"license": "MIT",
"homepage": "https://github.com/ruben-arushanyan/actions-creator",
"repository": {
Expand Down Expand Up @@ -31,6 +31,6 @@
"jest": "^26.6.3"
},
"dependencies": {
"produce-by-path": "^1.0.2"
"produce-by-path": "^1.0.3"
}
}

0 comments on commit 6854734

Please sign in to comment.