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.
redux-reactors
Advanced tools
A small library (~20 loc) for creating action/reducer combinations, also known as reactors.
$ npm install redux-reactors --save
import {reactorEnhancer} from 'redux-reactors';
import {createStore, compose} from 'redux';
// ...
const store = createStore(reducer, initialState, compose(reactorEnhancer, ...otherEnhancers));
import {createReactor} from 'redux-reactors';
export const incrementReactor = createReactor('INCREMENT', (state, action) => {
return Object.assign({}, {
counter: state.counter + action.payload,
state,
});
});
import {incrementReactor} from './my-reactors';
import {connect} from 'react-redux';
function MyComponent(props) {
const {increment, counter} = props;
return (
<div>
<div>The count is {counter}</div>
<button onClick={() => increment(1)}>Increment by one</button>
<button onClick={() => increment(2)}>Increment by two</button>
</div>
);
}
const mapStateToProps = (state) => {
return {
counter: state.counter,
};
};
// Since createReactor returns an action creator,
// you can use it easily with mapDispatchToProps
const mapDispatchToProps = {
increment: incrementReactor,
};
export default connect(mapStateToProps, mapDispatchToProps)(MyComponent);
FAQs
A small library for creating action/reducer combinations.
We found that redux-reactors 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.