1.0.0-beta.4 • Published 3 years ago
tg-saga-manager v1.0.0-beta.4
tg-saga-manager
Redux-Saga helper to hot-reload sagas. Also has support for retrying failed root sagas.
Usage
import { SagaHotReloader } from 'tg-saga-manager';
import rootSaga from './sagas';
// Create store ...
const sagaHotReloader = new SagaHotReloader(store, sagaMiddleware);
// Start root saga
// Root saga should accept 1 parameter determining if it was restarted or hot-reloaded
sagaHotReloader.startRootSaga(rootSaga);
if (module.hot) {
module.hot.accept('./sagas', () => {
sagaHotReloader.replaceRootSaga(require('./sagas').default);
console.log('🔁 HMR Reloaded `./sagas` ...');
});
}
Options
enableHotReload
: (boolean): Optionally to enable hot-reloading always or disable always. Defaults:process.env.NODE_ENV !== 'production'
maxRetries
: (number): Optional max retries count. Default:10
onError
: (Function): Optional Error handler with signature(error: any) => void
1.0.0-beta.4
3 years ago
1.0.0
4 years ago
1.0.0-beta.0
4 years ago
1.0.0-alpha.39
5 years ago
1.0.0-alpha.37
6 years ago
1.0.0-alpha.28
6 years ago
1.0.0-alpha.7
6 years ago
1.0.0-alpha.6
6 years ago
1.0.0-alpha.5
6 years ago
1.0.0-alpha.4
6 years ago
1.0.0-alpha.3
6 years ago
1.0.0-alpha.2
6 years ago
1.0.0-alpha.1
6 years ago