/redux-eggs

Add some Eggs to your Redux store.

Primary LanguageTypeScriptMIT LicenseMIT

Redux Eggs

Manipulate your store like an egg tray. Add some eggs to your Redux store.

Contents:

Intro

Here is a monorepository that contains packages that allow you to easily split your Redux store into separate parts (eggs), and then dynamically add and remove them when you need it. This set of packages will allow you to reduce the size of your Redux store and the first-load JavaScript by adding only the currently needed reducers and middlewares. You no longer have to add all reducers and middlewares at once when creating your Redux store. If you need some kind of reducer or middleware, you can dynamically add these constructs at runtime exactly when your application requires it. You will be able to create reusable constructs with reducers and middlewares so that you can easily connect them in different parts of your application. Moreover, if you need reusable parts of the Redux store in different projects, you can also create separate reusable packages and use them in your projects.

If you are familiar with Redux Dynamic Modules, then most likely you know what is going on here.

Main advantages

  • 🍳 Simple to use.
  • 🤏 Tiny small bundle size.
  • 👌 Zero dependencies.
  • ✅ SSR-ready.
  • ⚙️ Built-in event mechanism.
  • 🍒 Custom extensions.
  • 🐕‍🦺 React Strict Mode supported.

Packages

Core

@redux-eggs/core - a package that includes the main logic for adding and removing parts of Redux store, connecting extensions, triggering events, etc.

More details here.

Next

@redux-eggs/next - Redux Eggs wrapper for Next.js.

More details here.

React

@redux-eggs/react - a package that provides higher-order component (HOC) and function to create an injector component that allows you to add parts of Redux store before the component is mounted, and remove them after the component is unmounted.

More details here.

Redux

@redux-eggs/redux - a wrapper for directly creating dynamic Redux store with plain Redux.

More details here.

Redux Toolkit

@redux-eggs/redux-toolkit - a wrapper for directly creating dynamic Redux store with Redux Toolkit.

More details here.

Redux-Saga extension

@redux-eggs/saga-extension - an extension for Redux Eggs that allows you to dynamically add or remove sagas from your Redux store.

More details here.

Thanks

JetBrains