Methods
(inner) deepDelete(nodePath, childPathopt) → {InputFunction}
Once fully applied, this returns a new tree that no longer contains the node at nodePath
, or any of its child nodes.
If there is no node at nodePath
then no change will occur.
When no childPath
is provided then this is functionally equivalent to Immutable's deleteIn()
method.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
nodePath |
NodePath | A NodePath used to uniquely identify the node to delete. |
||
childPath |
ChildPath |
<optional> |
null
|
An |
Returns:
A partially applied function which accepts a single tree Iterable
, and returns the modified tree Iterable
.
- Type
- InputFunction
(inner) deepDeleteChildren(nodePath, childPathopt) → {InputFunction}
Once fully applied, this returns a new tree where the children of the node at nodePath
have been deleted. The child container will still remain.
This is the equivalent of calling the following:
deepUpdateChildren(nodePath, kids => kids.clear(), childPath);
No change will occur if any of the following circumstances are true:
- If there is no node at
nodePath
- If
childPath
is provided and the node has no childIterable
- If no
childPath
is provided and the node itself is notIterable
If no childPath
is provided and the node is Iterable
, then this has the same effect as calling clear()
on the node.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
nodePath |
NodePath | A |
||
childPath |
ChildPath |
<optional> |
null
|
An |
Returns:
A partially applied function which accepts a single tree Iterable
, and returns the modified tree Iterable
.
- Type
- InputFunction