ProtoTeam / Immutability Helper X
Licence: mit
The library extends the kolodny/immutability-helper to support update data by path string, like the get/set in lodash.
Stars: ✭ 86
Programming Languages
javascript
184084 projects - #8 most used programming language
Labels
Projects that are alternatives of or similar to Immutability Helper X
Tslint Immutable
TSLint rules to disable mutation in TypeScript.
Stars: ✭ 427 (+396.51%)
Mutual labels: immutability
Mithril Data
A rich data model library for Mithril javascript framework
Stars: ✭ 17 (-80.23%)
Mutual labels: lodash
Vue Boilerplate Template
🍎 Efficient development of web SPA using Vue.js(2.*) + Webpack + Element-ui + Pwa + Vuex + Vuex-router + Vue-i18n + Dayjs + Lodash.
Stars: ✭ 461 (+436.05%)
Mutual labels: lodash
Immutable Tuple
Immutable finite list objects with constant-time equality testing (===) and no memory leaks.
Stars: ✭ 29 (-66.28%)
Mutual labels: immutability
Logging Helpers
Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.
Stars: ✭ 5 (-94.19%)
Mutual labels: lodash
Performance Analysis Js
Map/Reduce/Filter/Find Vs For loop Vs For each Vs Lodash vs Ramda
Stars: ✭ 532 (+518.6%)
Mutual labels: lodash
Styled Tools
Useful interpolated functions for CSS-in-JS
Stars: ✭ 761 (+784.88%)
Mutual labels: lodash
Lodash Id
Makes it easy to manipulate id-based resources with lodash or lowdb
Stars: ✭ 434 (+404.65%)
Mutual labels: lodash
Smoldash
Smoldash, A tiny lodash alternative built for the modern web
Stars: ✭ 66 (-23.26%)
Mutual labels: lodash
Lodash Php
Easy to use utility functions for everyday PHP projects. This is a port of the Lodash JS library to PHP
Stars: ✭ 412 (+379.07%)
Mutual labels: lodash
Dash
Functional programming library for PHP. Inspired by Underscore, Lodash, and Ramda.
Stars: ✭ 84 (-2.33%)
Mutual labels: lodash
Typed Path
Type safe object field string paths for typescript.
Stars: ✭ 73 (-15.12%)
Mutual labels: lodash
Graphql Lodash
🛠 Data manipulation for GraphQL queries with lodash syntax
Stars: ✭ 1,003 (+1066.28%)
Mutual labels: lodash
immutability-helper-x
The library extends the kolodny/immutability-helper to support update by path string, like the get/set in lodash.
install
npm install -S immutability-helper-x
usage
import update, { updateChain } from 'immutability-helper-x';
const data = {
a: {
b: {
c: 1,
d: 2,
e: [3, 2, 1],
}
},
f: 4,
};
// 1. if you want to update the value of data.a.b, you can
update.$set(data, 'a.b', newValue);
// or
update.$set(data, ['a', 'b'], newValue);
// 2. other methods like push and apply in original update lib
update.$push(data, 'arr', ['car', 'bus']);
update.$apply(data, 'a.b', value => ++value);
// 3. extend method
// step 1
update.extend('$addtax', function(tax, original) {
return original + (tax * original);
});
// step 2
update.$addtax(data, 'price', 0.8);
// or
update(data, {
price: { $addtax: 0.8 },
});
// 4. update multiple values at the same time in a chain
const d = updateChain(data)
.$set('a.b.c', 444)
.$merge('a.b', {
d: 555,
})
.$push('a.e', [4])
.$unshift('a.e', [0])
.$splice('a.e', [[1, 0, 8]])
.$apply('a.b.d', val => val + 100)
.value();
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].