Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
primogenial
/
languages
/
wp-content-20241001222009
/
plugins
/
woocommerce
/
packages
/
woocommerce-blocks
/
assets
/
js
/
data
/
utils
:
update-state.js
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
/** * External dependencies */ import { setWith, clone } from 'lodash'; /** * Utility for updating state and only cloning objects in the path that changed. * * @param {Object} state The state being updated * @param {Array} path The path being updated * @param {*} value The value to update for the path * * @return {Object} The new state */ export default function updateState( state, path, value ) { return setWith( clone( state ), path, value, clone ); }