Immutable Set with Lodash

node v10.24.1
version: master
endpointsharetweet
const set = require('lodash/fp/set'); const setWith = require('lodash/fp/setWith'); const example = { entities: { 1: { title: 'First List', cards: [1, 2] }, 2: { title: 'Second List', cards: [3, 4] }, }, ids: [1, 2] }; set(['entities', 1, 'title'], 'Updated List', example);
set('entities.1.title', 'Updated (Again) List', example);
Loading…

no comments

    sign in to comment