Files
freeCodeCamp/guide/english/certifications/front-end-libraries/redux/define-an-action-creator/index.md

38 lines
496 B
Markdown
Raw Normal View History

2018-10-12 15:37:13 -04:00
---
title: Define an Action Creator
---
# Define an Action Creator
---
## Hints
2018-10-12 15:37:13 -04:00
### Hint 1
A function is defined using the following syntax:
```javascript
function functionName() {
2018-10-12 15:37:13 -04:00
console.log("Do something");
}
```
2018-10-12 15:37:13 -04:00
Where console.log can be changed as per the need.
### Hint 2
A value is returned using the ``` return ``` keyword
---
## Solutions
2018-10-12 15:37:13 -04:00
<details><summary>Solution 1 (Click to Show/Hide)</summary>
2018-10-12 15:37:13 -04:00
```javascript
function actionCreator() {
return action;
2018-10-12 15:37:13 -04:00
}
```
</details>