Skip to content

Commit a5e17f5

Browse files
committed
Changes in Readme
1 parent 9e781e2 commit a5e17f5

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ Create the `actions.js` file in the `src/usr/api` folder and add the following c
385385

386386
```javascript
387387
export const makeGreetingText = (userName) => (dispatch) => {
388-
dispatch('greeting', userName ? `Hello, ${userName} !!!` : 'Hello, Noname !!!');
388+
dispatch({greeting: userName ? `Hello, ${userName} !!!` : 'Hello, Noname !!!'});
389389
};
390390
```
391391

@@ -395,10 +395,9 @@ This is done intentionally because the framework recognizes only such syntax of
395395
Another feature of the function is a `dispatch` argument in the second function in the chain.
396396
The `dispatch` is a callback method which is injected by the framework during the function execution.
397397

398-
The first argument of the callback is the identification for the object which is passed in as the second argument.
399-
This is similar to the action type in action creators in Redux.
398+
The argument of the callback is the object with keys that serve as names for output payloads.
400399

401-
> Remember the name of the `greeting` dispatch - we use it in the flow configuration.
400+
> Remember the name of the `greeting` key in the dispatch - we use it in the flow configuration.
402401
403402
The function in `react-app-framework` is considered as a decoupled and independent component too.
404403
That's why we have to add the function into index files in the `src/app` directory in order the framework finds the function.
@@ -485,7 +484,7 @@ However, in the case of `userFunction` the events are any of `dispatch` mentione
485484
486485
Please note, component's events and function's dispatches produce only the first argument.
487486

488-
> For example, in `dispatch('greeting', someText, anotherText)` - `anotherText` will not be passed in the target property.
487+
> For example, in `dispatch({greeting: someText}, anotherText)` - `anotherText` will not be passed in the target property.
489488
490489
Once we've added all configurations, we can start the development server:
491490
```

0 commit comments

Comments
 (0)