Comparing version 0.0.2 to 0.0.3
{ | ||
"name": "esroute", | ||
"version": "0.0.2", | ||
"description": "", | ||
"version": "0.0.3", | ||
"description": "A small efficient framework-agnostic client-side routing library, written in TypeScript.", | ||
"main": "dist/index.js", | ||
@@ -16,3 +16,4 @@ "scripts": { | ||
], | ||
"author": "", | ||
"repository": "github:svi3c/esroute", | ||
"author": "Sven Rogge <sreglitzki@gmail.com>", | ||
"license": "ISC", | ||
@@ -19,0 +20,0 @@ "devDependencies": { |
@@ -144,1 +144,22 @@ # esroute | ||
`RouterConf.noClick` can be used to disable the default click behavior for anchor elements. | ||
## API | ||
### `Router.onResolve((res: Resolved<T>) => void): () => void` | ||
A router instance holds a callback registry. | ||
Your callback will be called initially with the currently resolved route and then every time a new route is resolved, but not yet placed on the history stack. | ||
`onResolve()` returns a function that you can call to unsubscribe the passed-in callback again. | ||
`Resolved<T>` looks like this: | ||
```ts | ||
interface Resolved<T> { | ||
value: T; | ||
opts: NavOpts; | ||
} | ||
``` | ||
So when the route is resolved, not only get passed the resolved value (for example a template or a DOM element), but also the `NavOpts` instance to gain access to path variables, search params or the state. |
No contributors or author data
MaintenancePackage does not specify a list of contributors or an author in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
25168
1
165