Socket
Socket
Sign inDemoInstall

@stackflow/plugin-history-sync

Package Overview
Dependencies
13
Maintainers
2
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.1.1-alpha.2 to 1.2.0

dist/queue.d.ts

125

dist/index.js

@@ -175,2 +175,26 @@ "use strict";

// src/queue.ts
var makeQueue = (history) => {
let pending = false;
const queue = (cb) => {
const start = () => {
pending = true;
const clean = history.listen(() => {
clean();
pending = false;
});
cb();
};
if (pending) {
const clean = history.listen(() => {
clean();
start();
});
} else {
start();
}
};
return queue;
};
// src/RoutesContext.tsx

@@ -199,2 +223,3 @@ var import_react = require("react");

let popFlag = 0;
const queue = makeQueue(history);
return {

@@ -287,11 +312,13 @@ key: "plugin-history-sync",

const lastStep = last(rootActivity.steps);
replaceState({
history,
pathname: template.fill(rootActivity.params),
state: {
activity: rootActivity,
step: lastStep
},
useHash: options.useHash
});
queue(
() => replaceState({
history,
pathname: template.fill(rootActivity.params),
state: {
activity: rootActivity,
step: lastStep
},
useHash: options.useHash
})
);
const onPopState = (e) => {

@@ -398,10 +425,12 @@ if (popFlag) {

);
pushState({
history,
pathname: template.fill(activity.params),
state: {
activity
},
useHash: options.useHash
});
queue(
() => pushState({
history,
pathname: template.fill(activity.params),
state: {
activity
},
useHash: options.useHash
})
);
},

@@ -417,11 +446,13 @@ onStepPushed({ effect: { activity, step } }) {

);
pushState({
history,
pathname: template.fill(activity.params),
state: {
activity,
step
},
useHash: options.useHash
});
queue(
() => pushState({
history,
pathname: template.fill(activity.params),
state: {
activity,
step
},
useHash: options.useHash
})
);
},

@@ -436,10 +467,12 @@ onReplaced({ effect: { activity } }) {

);
replaceState({
history,
pathname: template.fill(activity.params),
state: {
activity
},
useHash: options.useHash
});
queue(
() => replaceState({
history,
pathname: template.fill(activity.params),
state: {
activity
},
useHash: options.useHash
})
);
},

@@ -454,11 +487,13 @@ onStepReplaced({ effect: { activity, step } }) {

);
replaceState({
history,
pathname: template.fill(activity.params),
state: {
activity,
step
},
useHash: options.useHash
});
queue(
() => replaceState({
history,
pathname: template.fill(activity.params),
state: {
activity,
step
},
useHash: options.useHash
})
);
},

@@ -497,3 +532,3 @@ onBeforePush({ actionParams, actions: { overrideActionParams } }) {

popFlag += 1;
history.back();
queue(history.back);
}

@@ -511,3 +546,3 @@ },

for (let i = 0; i < popCount; i += 1) {
history.back();
queue(history.back);
}

@@ -514,0 +549,0 @@ } while (!safeParseState(getCurrentState({ history })));

{
"name": "@stackflow/plugin-history-sync",
"version": "1.1.1-alpha.2+e3b0f3bc",
"version": "1.2.0",
"license": "MIT",

@@ -41,6 +41,6 @@ "exports": {

"devDependencies": {
"@stackflow/core": "^1.0.2",
"@stackflow/core": "^1.0.3",
"@stackflow/esbuild-config": "^1.0.0",
"@stackflow/eslint-config": "^1.0.0",
"@stackflow/react": "^1.0.2",
"@stackflow/react": "^1.0.3",
"@swc/core": "^1.3.35",

@@ -83,3 +83,3 @@ "@swc/jest": "^0.2.24",

},
"gitHead": "e3b0f3bc3fc896bebf1ba59b016689e6917679f1"
"gitHead": "11774f22968cea55a1e287bbf07096ce0e5e0f5f"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc