Observed since 20 Oct, 21:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
76
Lightweight wrapper of React + Router + Redux-saga for SPA development.
Lightweight (300 lines) wrapper of React + Redux + Router + saga for SPA development.
npm i -S 76
import { Application, Module } from '76';
const app = new Application('test-app');
const module = new Module('user-list', {
initialState,
selectors,
reducers,
watchers,
});
app.addModule(module);
app.setRouter(router);
app.start('#web-container', () => { console.log('app start success!'); })
How to write initialState, selectors, reducers, watchers of module?
initialStateinitialState is the initial state of module, used to initial store of redux. It is a pure object.
const initialState = {
domain: {
users: [],
},
ui: {
loading: false,
},
};
selectorsselectors is used to select the data of module state.
const selectors = {
getUserList: state => state.domain.users
};
reducersreducers is a pure function transform old state to new state.
const reducers = {
addUser: (state, user) => {
// use immutable-helper
return update(state, {
domain: {
users: {
$push: [user],
},
},
});
},
...
};
watcherswatchers is the redux action with side-effect, see document of redux-saga.
const watchers = [{
take: 'takeEvery',
actions: 'addUserAsync',
generator: function*(selectors, actions, { payload }) {
// do something with effects.
},
}];
ISC@hustcc.
npm · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-22 | 1 | 2026-10-22T19:19:14.6926792Z |
Declarations describe requirements; they are not a resolved dependency graph.
Source distribution
{
"shasum": "91e4530e308b6ddfb428f31a9219b67f501fa346",
"tarball": "https://registry.npmjs.org/76/-/76-1.0.0.tgz",
"integrity": "sha512-M1afK37sqiTs6C4eEDCBq7s/ru91QEYaEsV43HARCh0lDDMoaxxiSuWS+A8ugyuaSrIbfOPbgqEJl3DnyX/q1Q==",
"signatures": [
{
"keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
"sig": "MEUCIEpT7FislO/LUAJLeqK/mSXeJLyZ4V02BkX5jHuSXM35AiEAqZAxExADsuGkQisPxEeUYd+s0pranVviWJR9MUPkJ0o="
}
]
}Observed since 20 Oct, 21:04 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package_version:bee19f48c49fd2bdfb5d3252b1f3597e90fec4e0d3bdb3fd9fd8e937f5c724c3