@@ -385,7 +385,7 @@ Create the `actions.js` file in the `src/usr/api` folder and add the following c
385385
386386``` javascript
387387export 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
395395Another feature of the function is a ` dispatch ` argument in the second function in the chain.
396396The ` 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
403402The function in ` react-app-framework ` is considered as a decoupled and independent component too.
404403That'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
486485Please 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
490489Once we've added all configurations, we can start the development server:
491490```
0 commit comments