New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

esroute

Package Overview
Dependencies
Maintainers
1
Versions
24
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

esroute - npm Package Compare versions

Comparing version 0.0.2 to 0.0.3

7

package.json
{
"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.
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc