Skip to content

Commit

Permalink
Updating docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Krasimir Tsonev committed Jan 16, 2021
1 parent b8ab8ff commit 7948bba
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
## 8.6.4

Refactoring the leave hook implementation. The leave hook check now run a bit earlier and once per navigating. So far it was running for each of the matched routes. Also the hook now may accept an array of matches. Not only a single Match object.

## 8.6.2, 8.6.3

Fixing a bug with matching a wildcard.
Expand Down
4 changes: 2 additions & 2 deletions DOCUMENTATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ type RouteHooks = {

* The `before` hook receives two arguments. The first one is a function that needs to be called with either no arguments or `false`. The no-argument version means "move forward". `false` stops the resolving and your handler will not be called.
* `after` is called after your handler
* `leave` is called when you are about to leave out of the route. Similarly to the `before` hook accepts a function as first argument and a [Match](#match) object as second. If the function is called with `false` Navigo will stop resolving the new matched route meaning "we cant' go out of the current route".
* `leave` is called when you are about to leave out of the route. Similarly to the `before` hook accepts a function as first argument and a [Match](#match) object (or an array of [Match](#match) objects) as second. If the function is called with `false` Navigo will stop resolving the new matched route meaning "we cant' go out of the current route".
* `already` is called when this is the current route and it matches again

### Defining hooks for specific route
Expand Down Expand Up @@ -693,7 +693,7 @@ type Route = {
type RouteHooks = {
before?: (done: Function, match: Match) => void;
after?: (match: Match) => void;
leave?: (done: Function, match: Match) => void;
leave?: (done: Function, match: Match | Match[]) => void;
already?: (match: Match) => void;
};
```
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "navigo",
"version": "8.6.3",
"version": "8.6.4",
"description": "A simple vanilla JavaScript router",
"main": "lib/navigo.js",
"browser": "lib/navigo.min.js",
Expand Down

0 comments on commit 7948bba

Please sign in to comment.