Skip to content

Commit

Permalink
Slightly extend docs
Browse files Browse the repository at this point in the history
  • Loading branch information
lukastaegert committed Dec 14, 2020
1 parent 8fd8cd8 commit db723b2
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions docs/02-javascript-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,13 @@ watcher.on('event', event => {
// * event.error contains the error that was thrown
});

// This will make sure that bundles are properly closed after each run
watcher.on('event', ({ code, result }) => {
if (code === 'BUNDLE_END') {
result.close();
}
});

// stop watching
watcher.close();
```
Expand Down

0 comments on commit db723b2

Please sign in to comment.