1.0.0-beta.4 • Published 2 years ago
@thorgate/spa-view-manager v1.0.0-beta.4
@thorgate/spa-view-manager
Redux-Saga runners used by Thorgate project template SPA variant
Usage
import { ViewManager, ServerViewManagerWorker, takeEveryWithMatch } from '@thorgate/spa-view-manager';
function* dataLoaderSaga(match: MatchWithRoute, action) {
console.log('React router match', match);
yield put({ type: 'TEST' });
}
function* watcherAction(match, action) {
console.log('take helper with match', match, action);
}
function* watcher() {
yield takeEveryWithMatch('TEST', '/', watcherAction);
}
// Example route config
const routes = [
{
path: '/',
exact: true,
component: () => null,
initial: dataLoaderSaga,
}, {
name: 'path-name',
path: '/path-name',
exact: true,
component: () => null,
initial: asd,
}
];
// Client root saga
function* rootSaga() {
yield fork(ViewManager);
}
// Server side root saga
sagaMiddleware.run(ServerViewManagerWorker, routes, createLocationAction(store.getState().router));
1.0.0-beta.4
2 years ago
1.0.0-beta.2
3 years ago
1.0.0-beta.0
3 years ago
1.0.0-alpha.39
5 years ago
1.0.0-alpha.38
5 years ago
1.0.0-alpha.37
5 years ago
1.0.0-alpha.30
5 years ago
1.0.0-alpha.29
5 years ago
1.0.0-alpha.28
5 years ago
1.0.0-alpha.25
5 years ago
1.0.0-alpha.24
5 years ago
1.0.0-alpha.23
5 years ago
1.0.0-alpha.22
5 years ago
1.0.0-alpha.21
5 years ago
1.0.0-alpha.20
5 years ago
1.0.0-alpha.19
5 years ago
1.0.0-alpha.14
5 years ago
1.0.0-alpha.7
5 years ago
1.0.0-alpha.6
5 years ago
1.0.0-alpha.5
5 years ago
1.0.0-alpha.4
5 years ago
1.0.0-alpha.3
5 years ago
1.0.0-alpha.2
5 years ago
1.0.0-alpha.1
5 years ago