Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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?
initialState
initialState
is the initial state of module, used to initial store of redux. It is a pure object.
const initialState = {
domain: {
users: [],
},
ui: {
loading: false,
},
};
selectors
selectors
is used to select the data of module state.
const selectors = {
getUserList: state => state.domain.users
};
reducers
reducers
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],
},
},
});
},
...
};
watchers
watchers
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.
FAQs
Lightweight wrapper of React + Router + Redux-saga for SPA development.
We found that 76 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.