
Research
2025 Report: Destructive Malware in Open Source Packages
Destructive malware is rising across open source registries, using delays and kill switches to wipe code, break builds, and disrupt CI/CD.
immutable-functions
Advanced tools
A simple, easy, straight forward approach to update immutable data.
A simple, easy, straight forward approach to update immutable data.
$ yarn add immutable-functions
or
$ npm install -s immutable-functions
import _i from 'immutable-functions';
import { CREATE, UPDATE, REMOVE } from '../actions/collection';
export default (state = [], action) => {
switch (action.type) {
case CREATE:
return _i.create(state, action.obj);
case UPDATE:
return _i.update(state, action.obj.id, action.obj);
case REMOVE:
return _i.destroy(state, action.obj.id);
default:
return state;
}
};
import React, { PureComponent } from 'react';
import { View, Text } from 'react-native';
import { connect } from 'react-redux';
import _i from 'immutable-functions';
class YourComponent extends PureComponent {
render() {
// Get the item with id === 5
const item = _i.find(this.props.data, 5)
// item
// {
// id: 5,
// name: Jerry,
// email: jerry@gmail.com
// }
return (
<View>
<Text>Name: {item.name}</Text>
<Text>Email: {item.email}</Text>
</View>
);
}
}
// Here are the properties of the store this component uses
const mapStoreToProps = store => ({
data: store.yourReducer
});
// This is how we connect the store to our component
export default connect(mapStoreToProps)(YourComponent);
_i.create(state, data)
Creates an object if it does not already exist (by id) in the array.
_i.update(state, id, data)
Updates an object if it exists (by id) in the array, if it does not exist, it will create it.
_i.destroy(state, id)
Destroys an object if it exists (by id) in the array.
_i.merge(state, array[, deep])
Merges an object or array of objects (unique by id) with the current state.
id_i.find(state, id)
Find an object if it exists (by id) in the array. Useful in components when accessing the data.
_i.findByProp(state, prop, id)
Find an object if it exists by a property provided in the array. Useful in components when accessing the data.
_i.findByProp(state, 'LoanId', '1234456');_i.updateByProp(state, prop, id, data)
Updates an object if it exists by an identifier property provided in the array, if it does not exist, it will create it.
_i.updateByProp(state, 'LoanId', action.obj.LoanId, action.obj); _i.destroyByProp(state, prop, id)
Destroy an object if it exists by an identifier property provided in the array.
_i.destroyByProp(state, 'LoanId', action.obj.LoanId); _i.mergeByProp(state, array, prop[, deep])
Merges an object or array of objects (unique by prop) with the current state.
FAQs
A simple, easy, straight forward approach to update immutable data.
The npm package immutable-functions receives a total of 41 weekly downloads. As such, immutable-functions popularity was classified as not popular.
We found that immutable-functions 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.

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.

Research
/Security News
A five-month operation turned 27 npm packages into durable hosting for browser-run lures that mimic document-sharing portals and Microsoft sign-in, targeting 25 organizations across manufacturing, industrial automation, plastics, and healthcare for credential theft.