Search Header Logo

Action creators + combineReducers

Authored by Shashwat Tyagi

Computers

Professional Development

Used 2+ times

Action creators + combineReducers
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

7 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is an action creator?

It is a string describing what action is to be performed.

It is a function that creates and returns a particular action object.

Action object itself is the action creator

None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Why should we use an action creator?

To avoid the effort of typing the action object every time we want to dispatch an action.

To prevent potential bugs that might occur due to a typo while passing an action object to dispatch().

To have a consistent approach for creating action objects.

All of the above

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Once an action creator is defined, how can we use it to dispatch an action?

No need to do anything explicitly, React will implicitly pass the required action creator to dispatch().

Pass the action object returned by the action creator, to the dispatch()

Pass the action creator function itself to dispatch()

None of the above

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In “createStore.js”, what is the default value of state?

null

undefined

NaN

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Initialization of state will happen when the state changes and not during the initial render. To overcome this we use a dummy dispatch with an empty object.

True

False

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you use combineReducers to create a root reducer?

Pass an array of reducers to combineReducers()

Pass the reducer with the most lines of code to combineReducers()

Pass an object whose values are different reducing functions, to combineReducers()

None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In our Todo application, what does the format/shape of the global state object look like, once it is constructed by combineReducers()?

{ isDarkMode: value-of-isDarkMode, filterStatus: value-of-filterStatus }

{ “preferencesReducer”: { isDarkMode: value-of-isDarkMode }, “todoReducer”: { filterStatus: value-of-filterStatus } }

[{ isDarkMode: value-of-isDarkMode }, { filterStatus: value-of-filterStatus }]

None of the above

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?