* chore(learn): audit bootstrap * chore(learn): audit FE projects * chore(learn): audit jQuery * chore(learn): audit React * chore(learn): audit react-redux * chore(learn): audit redux * chore(learn): audit sass * fix: apply review suggestions Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> * fix: apply non-suggestions * chore: remove comments from code Co-authored-by: Randell Dawson <5313213+RandellDawson@users.noreply.github.com>
1.1 KiB
1.1 KiB
id, title, challengeType, forumTopicId, dashedName
id | title | challengeType | forumTopicId | dashedName |
---|---|---|---|---|
5a24c314108439a4d403614e | Define an Action Creator | 6 | 301441 | define-an-action-creator |
--description--
After creating an action, the next step is sending the action to the Redux store so it can update its state. In Redux, you define action creators to accomplish this. An action creator is simply a JavaScript function that returns an action. In other words, action creators create objects that represent action events.
--instructions--
Define a function named actionCreator()
that returns the action
object when called.
--hints--
The function actionCreator
should exist.
assert(typeof actionCreator === 'function');
Running the actionCreator
function should return the action
object.
assert(typeof action === 'object');
The returned action
should have a key property type
with value LOGIN
.
assert(action.type === 'LOGIN');
--seed--
--seed-contents--
const action = {
type: 'LOGIN'
}
// Define an action creator here:
--solutions--
const action = {
type: 'LOGIN'
}
const actionCreator = () => {
return action;
};