
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
@sigmadigital/duxedo
Advanced tools
simple utility for reducing redux boilerplate and helping you scale redux
A tiny, easy to use utility to help you write cleaner code, and scale redux easily.
Take a single object definition of actions and how state changes, and produce an object containing immutable action constants, an object containing consistent FSA compliant action creators and a reducer function that can be included easily in your store configuration, or components, just the way you would usually. No extra fuss.
Managing state with redux requires quite a bit of boilerplate code, especially when you begin to use consistent patterns for action creators for example, you end up repeating yourself a great deal. Secondly as your app grows, recalling which actions do what, and how becomes a hunt through growing switch statements, and multiple files. Not to mention that this growing API for your local application state, can increase the time it takes to on-board new team members, along with increasing support, maintenance, and iteration time.
install with npm:
npm install --save @sigmadigital/duxedo
or with yarn:
yarn add @sigmadigital/duxedo
Add your dependencies if you haven't already:
npm install --save react redux react-dom react-redux
NB: You'll likely need a build pipeline (ie: webpack, parcel or rollup etc) with babel to transpile es6/es7+..
// src/store/definitions/counter.js
import duxedo from '@sigmadigital/redux-helpers';
// define your default state
const defaultState = { count: 0 };
// Define your actions and how state should change
const definition = {
INCREMENT: state => ({ ...state, count: state.count + 1 }),
DECREMENT: state => ({ ...state, count: state.count - 1 }),
SET: (state, { payload }) => ({ ...state, count: payload.count }),
RESET: state => ({ ...state, count: 0 }),
};
// this exports an object containing reducer, constants, actions
export const { reducer, actions, constants } = duxedo({
definition,
defaultState,
});
// src/store/index.js
import { createStore, combineReducers } from 'redux';
import { reducer as counter } from './definitions/counter';
export default () => createStore(combineReducers({ counter }));
the duxedo function takes the definition as above, and the default state, that you would usually pass to your reducer function and returns an object:
{
reducer, // function to be passes to the store
actions, // object containing action creator functions, note that the action names have been transformed to **camelCase**
constants, // the actions in original case, as an object
}
Have a look at the /example directory for a full example with redux and react. Alternatively, have a look at the example app or fork the sandbox here:
If you find an issue, have an idea or would like to contribute, either let us know in the issues, or fork our repo, and open a pull request. If you do, please ensure all tests are passing, and that any new items have coverage as well.
A Sigma Digital Project. Copyright 2019. License MIT.
FAQs
simple utility for reducing redux boilerplate and helping you scale redux
We found that @sigmadigital/duxedo demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.