mirror of
https://github.com/flynx/walk.js.git
synced 2025-12-20 18:41:44 +00:00
added exit mode to done(..)
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
d91fbb5c3a
commit
a5ea1e9a7c
@ -170,8 +170,8 @@ Stop walking and return `state`. The passed `state` is directly returned from th
|
|||||||
|
|
||||||
#### `done(..)`
|
#### `done(..)`
|
||||||
|
|
||||||
`done(state) -> state`
|
`done(state, mode) -> state`
|
||||||
User provided function, if given, is called by the *walker* after walking is done (no more nodes to handle). `state` is passed as argument and the return value is returned from the *walker*. This is run in the same context (`this`) as `getter(..)`.
|
User provided function, if given, is called by the *walker* after walking is done (no more nodes to handle). `state` is passed as argument and the return value is returned from the *walker*. If walking was stopped via `stop(..)` mode will be `'stopped'` otherwise it is `'done'`. This is run in the same context (`this`) as `getter(..)`.
|
||||||
|
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "generic-walk",
|
"name": "generic-walk",
|
||||||
"version": "1.3.1",
|
"version": "1.4.0",
|
||||||
"description": "An extensible tree walk(..) framework...",
|
"description": "An extensible tree walk(..) framework...",
|
||||||
"main": "walk.js",
|
"main": "walk.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user