mirror of
https://github.com/flynx/walk.js.git
synced 2025-10-28 10:30:10 +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(state) -> 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(..)`.
|
||||
`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*. 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
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "generic-walk",
|
||||
"version": "1.3.1",
|
||||
"version": "1.4.0",
|
||||
"description": "An extensible tree walk(..) framework...",
|
||||
"main": "walk.js",
|
||||
"scripts": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user