Creating Reducers with createReducer

Get started with the createStore utility provided by Redux toolkit. In addition, learn how to simplify the creation of Redux reducers.

Creating reducers with createReducer

Of all Redux main actors, reducers getS the worst rap. Everyone seems to have something against them. From the widely annoying switch statements to the immutability constraints you have to employ, it’s easy to see why.

Well, let’s see what RTK’s has to offer to cure some of these woes.

The createReducer helper function, as you may have guessed, helps you write reducers with ease. Let’s explore its basic API.

Consider the Flappy reducer:

Get hands-on with 1200+ tech skills courses.