redux-subspace
redux-subspace copied to clipboard
Build decoupled, componentized Redux apps with a single global store
redux-subspace
Deprecated
This library is no longer being actively maintained.
IOOF has been slowly moving away from the ubiquitous use of Redux as a core piece of our micro-frontend architecture and have been actively replacing the usage of this library with more standard React and JavaScript patterns. Due to some technical constraints, we've also been unable to upgrade to the latest version of the library ourselves for quite some time now, further fuelling our desire to move away from this solution.
At this time, we will be ceasing all maintenance tasks and we recommend that you consider using an alternative library:
If you want to continue using this library, we encourage you to fork this repo and take over maintenance yourself.
This is a library to help build decoupled, componentized Redux apps that share a single global store.
Installation
npm install --save redux-subspace react-redux-subspace
Quick Start
import React from 'react'
import { createStore, combineReducers } from 'redux'
import { Provider } from 'react-redux'
import { namespaced } from 'redux-subspace'
import { SubspaceProvider } from 'react-redux-subspace'
import { TodoApp, todoReducer } from './todoApp'
import { CounterApp, counterReducer } from './counterApp'
const rootReducer = combineReducers({
todo: todoReducer
counter1: namespaced('counter1')(counterReducer),
counter2: namespaced('counter2')(counterReducer)
})
const store = createStore(rootReducer)
const App = () => (
<Provider store={store}>
<SubspaceProvider mapState={(state) => state.todo}>
<TodoApp />
</SubspaceProvider>
<SubspaceProvider mapState={(state) => state.counter1} namespace="counter1">
<CounterApp />
</SubspaceProvider>
<SubspaceProvider mapState={(state) => state.counter2} namespace="counter2">
<CounterApp />
</SubspaceProvider>
</Provider>
)
Documentation
Packages
-
redux-subspace
: The core package for Redux Subspace -
react-redux-subspace
: React bindings compatible withreact-redux
-
redux-subspace-loop
: Utilities for integrating withredux-loop
-
redux-subspace-observable
: Utilities for integrating withredux-observable
-
redux-subspace-saga
: Utilities for integrating withredux-saga
-
redux-subspace-wormhole
: Middleware for exposing additional state to subspaces
Upgrading From Version 1 to Version 2
When upgrading to version 2 of Redux Subspace, refer to the migration guide to work through all the breaking changes.
Media
- Scaling React and Redux at IOOF - MelbJS (Vivian Farrell, Emily Rosengren)
- You might Need Redux (And Its Ecosystem) - React Boston (Mark Erikson)
- From Monolith to Micro-Frontends - Web Developer 42ห (Michael Peyper)
Contributors
Thanks goes to these wonderful people (emojis):
Michael Peyper ๐ฌ ๐ ๐ป ๐ ๐ก ๐ค ๐ ๐ ๐ฆ ๐ข โ ๏ธ ๐ง |
Jonathan Peyper ๐ฌ ๐ป ๐ค ๐ โ ๏ธ |
Vivian Farrell ๐ค ๐ฆ ๐ ๐ข |
Emily Rosengren ๐ข |
Morgan Larosa ๐ |
Amit Kothari ๐ป ๐ก |
Riku Rouvila ๐ป ๐ โ ๏ธ |
Michael ๐ป |
James Adams ๐ |
Lee Kyles ๐ป โ ๏ธ |
Evert Bouw ๐ป โ ๏ธ ๐ ๐ก |
Paweล Brรณd ๐ |
majo44 ๐ ๐ป โ ๏ธ |
Garth Newton ๐ ๐ |
Mateusz Burzyลski ๐ง |
psamusev ๐ |
Jay Phelps ๐ |
Mark Erikson ๐ข |
Nikita ๐ ๐ป โ ๏ธ |
Conrad Buck ๐ป โ ๏ธ ๐ |
travikk ๐ |
This project follows the all-contributors specification. Contributions of any kind are welcome!