Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
cheton authored Jul 29, 2017
1 parent 13c727e commit 6e15078
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,13 @@ const renderer = (node, treeOptions) => {
};
```
The filter function accepts a keyword string, or a function to test each node of the tree. The function returns <i>true</i> to keep the node, <i>false</i> otherwise.
##### Usage
```js
tree.filter(predicate, options)
```
Use a string or a function to test each node of the tree. Otherwise, it will render nothing after filtering (e.g. tree.filter(), tree.filter(null), tree.flter(0), tree.filter({}), etc.). If the predicate is an empty string, all nodes will be filtered. If the predicate is a function, returns <i>true</i> to keep the node, <i>false</i> otherwise.
##### Filter by string
Expand Down

0 comments on commit 6e15078

Please sign in to comment.