Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@jack-henry/web-component-router

Package Overview
Dependencies
Maintainers
4
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@jack-henry/web-component-router - npm Package Compare versions

Comparing version 2.0.3 to 3.0.0

44

lib/page.js

@@ -51,3 +51,3 @@ /**

/** @typedef {function(!Context, function():?):?} */
/** @typedef {function(!Context, function(...?):?):?} */
let PageCallback;

@@ -223,5 +223,5 @@

* @param {boolean=} push
* @return {!Context}
* @return {!Promise<!Context>}
*/
show(path, state, dispatch, push) {
async show(path, state, dispatch, push) {
const ctx = new Context(path, state, this);

@@ -232,3 +232,3 @@ const prev = this.prevContext;

if (false !== dispatch) {
this.dispatch(ctx, prev);
await this.dispatch(ctx, prev);
}

@@ -320,33 +320,17 @@ if (false !== ctx.handled && false !== push) {

*/
dispatch(ctx, prev) {
let i = 0;
let j = 0;
const page = this;
function nextExit() {
let fn = page.exits[j++];
if (!fn) {
return nextEnter();
async dispatch(ctx, prev) {
if (prev) {
// Exit callbacks
for (const fn of this.exits) {
await new Promise((resolve) => fn(prev, resolve));
}
fn(prev, nextExit);
}
function nextEnter() {
let fn = page.callbacks[i++];
if (ctx.path !== page.current) {
// Entry callbacks
for (const fn of this.callbacks) {
if (ctx.path !== this.current) {
ctx.handled = false;
return;
}
if (!fn) {
return unhandled.call(page, ctx);
}
fn(ctx, nextEnter);
await new Promise((resolve) => fn(ctx, resolve));
}
if (prev) {
nextExit();
} else {
nextEnter();
}
unhandled.call(this, ctx);
}

@@ -353,0 +337,0 @@

{
"name": "@jack-henry/web-component-router",
"version": "2.0.3",
"version": "3.0.0",
"description": "Web Components Router",

@@ -36,3 +36,3 @@ "main": "router.js",

"socket.io-parser": "^4.2.3",
"qs":"^6.7.3",
"qs": "^6.7.3",
"engine.io": "^6.4.2"

@@ -39,0 +39,0 @@ },

@@ -229,3 +229,5 @@ /**

async routeChangeCallback_(routeTreeNode, context, next) {
this.routeChangeStartCallbacks_.forEach((cb) => cb());
for (const cb of this.routeChangeStartCallbacks_) {
cb();
}
this.prevNodeId_ = this.currentNodeId_;

@@ -242,3 +244,5 @@ this.currentNodeId_ = routeTreeNode.getKey();

this.nextStateWasPopped = false;
this.routeChangeCompleteCallbacks_.forEach((cb) => cb(routeError));
for (const cb of this.routeChangeCompleteCallbacks_) {
cb(routeError);
}
}

@@ -245,0 +249,0 @@

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