Meta-Reducers in ngrx/store

You don’t really need middleware

The ngrx team decided that we don’t need middleware anymore, in most cases, we can use meta-reducers to achieve the same effects.

What is a meta-reducer?

A meta-reducer is just a fancy name for higher order reducer (i.e., function).

Because a reducer is just a function, we can implement higher order reducer — “meta reducer.”

higher order function is a function that may receive a function as parameter or even return a function.

In simple words —

Take a reducer, do what you need and return a new reducer.

ref: https://netbasal.com/implementing-a-meta-reducer-in-ngrx-store-4379d7e1020a

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s