Skip to content
This repository has been archived by the owner on Sep 10, 2024. It is now read-only.

convoyinc/combined-reduction

Repository files navigation

combined-reduction

Like Redux's combineReducers, but more better!

Nested Reducers

Everyone loves a little hierarchy! Place your reducers at any depth in the store:

const reducer = combinedReduction({
  session: session.reducer,
  entities: {
    users: users.reducer,
  },
});

Top Level Reducers

Now, you could use compose to chain together multiple top level reducers, but what's the fun in that?

How about declaring all your reducers in one handy place:

const reducer = combinedReduction(
  migrations.reducer,
  {
    session: session.reducer,
    entities: {
      users: users.reducer,
    },
  },
);

Top level reducers are passed directly as arguments, and are processed in order.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published