π―destination path
Last updated
Last updated
As we know, in Redux, the state is represented as a tree or a JSON object. At times, it becomes necessary to modify a nested object or a leaf in the tree. In order to achieve this, a destination path is provided, which points to the specific object that needs to be modified.
For example: we want to modify the name
inside company
inside the User
. We have to write a path to go to that named object.
In this case, we use >
symbol to point out
In order to see how to use the Destination Path, we can examine an example of an insert function where we aim to insert an object into a leaf node of the tree.
Example of using Destination Path
I want to insert { gps: {x,y,z} }
into User>address>geo
Update companies
with cid=5
in students
with id=4
in MyClass