
Security News
GitHub Actions Pricing Whiplash: Self-Hosted Actions Billing Change Postponed
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.
lodash-redux-immutability
Advanced tools
Lean immutable wrappers around lodash get/set/update/delete, especially helpful for redux reducers.
Lean (just 24 lines of code!) immutable wrappers around lodash get/set/update/delete, especially helpful for redux reducers.
npm install lodash-redux-immutability --save
lodash.clone;
lodash.get;
lodash.isempty;
lodash.isnumber;
lodash.isstring;
lodash.setwith;
lodash.unset;
✅ 100%
When setting/updating, passing a number (ie, 3) in your path will look for an array at index 3 , but passing a "string-number" (ie, '3') will look for an object with a key of '3'.
Source
|
Tests
Merges (spreads) valueToUpdate at path inside of state with the current value found at this path, creating any keys in path that do not exist, returning a new object where affected objects in the path have a new reference.
import { updateIn } from 'lodash-redux-immutability';
const state = {
stores: {
'3': {
name: 'three'
'4': {
name: 'four'
}
}
};
const storeThreeUpdates = { location: 'Third street' };
const newState = updateIn(state, ['stores', '3'], storeThreeUpdates);
newState.stores['3']; // { name: 'three', 'location: 'Third street' };
newState.stores === state.stores; // false
newState.stores['3'] === state.stores['3']; // false
newState.stores['4'] === state.stores['4']; // true
Replaces valueToSet at path inside of state, creating any keys in path that do not exist, returning a new object where affected objects in the path have a new reference.
import { setIn } from 'lodash-redux-immutability';
const state = {
stores: {
'3': {
name: 'three'
}
'4': {
name: 'four'
}
}
};
const newState = setIn(state, ['stores', '3', 'name'], 'tres');
newState.stores['3']; // { name: 'tres' }
newState.stores === state.stores; // false
newState.stores['3'] === state.stores['3']; // false
newState.stores['4'] === state.stores['4']; // true
Deletes the value at path inside of state, returning a new object where affected objects in the path have a new reference.
import { deleteIn } from 'lodash-redux-immutability';
const state = {
'3': {
name: 'three'
},
'4': {
name: 'four'
}
};
const newState = deleteIn(state, ['stores', '3'];
newState.stores['3']; // undefined
newState.stores === state.stores; // false
newState.stores['4'] === state.stores['4']; // true
Get a value from an object by path. Returns the value, unless path is an empty [], in which case returns the original object
import { getIn } from 'lodash-redux-immutability';
const state = {
stores: {
'3': {
name: 'three'
}
}
};
const storeThreeName = getIn(state, ['stores', '3', 'name']); // 'three'
const entireState = getIn(state, []); // the entire 'state' object (this is what makes `getIn` different from the traditional `_.get`)
MIT
FAQs
Lean immutable wrappers around lodash get/set/update/delete, especially helpful for redux reducers.
We found that lodash-redux-immutability 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
GitHub postponed a new billing model for self-hosted Actions after developer pushback, but moved forward with hosted runner price cuts on January 1.

Research
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.

Security News
Socket CTO Ahmad Nassri shares practical AI coding techniques, tools, and team workflows, plus what still feels noisy and why shipping remains human-led.