Socket
Socket
Sign inDemoInstall

@stackflow/plugin-history-sync

Package Overview
Dependencies
13
Maintainers
3
Versions
109
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.3.15 to 1.3.16

2

dist/HistoryQueueContext.d.ts
/// <reference types="react" />
export declare type HistoryQueueContextValue = {
requestHistoryTick: (action: () => void, listen?: boolean) => void;
requestHistoryTick: (cb: (resolve: () => void) => void) => void;
};

@@ -5,0 +5,0 @@ export declare const HistoryQueueContext: import("react").Context<HistoryQueueContextValue>;

@@ -207,15 +207,13 @@ "use strict";

let previousTask = Promise.resolve();
const requestHistoryTick = (cb, listen = true) => {
const requestHistoryTick = (cb) => {
previousTask = previousTask.then(
() => new Promise((resolve) => {
if (listen) {
const clean = history.listen(() => {
clean();
resolve();
});
}
cb();
if (!listen) {
const clean = history.listen(() => {
clean();
resolve();
}
});
cb(() => {
clean();
resolve();
});
})

@@ -554,10 +552,16 @@ );

if (previousActivity) {
do {
for (let i = 0; i < previousActivity.steps.length - 1; i += 1) {
requestHistoryTick(() => {
for (let i = 0; i < previousActivity.steps.length - 1; i += 1) {
requestHistoryTick((resolve) => {
if (!safeParseState(getCurrentState({ history }))) {
silentFlag = true;
history.back();
});
}
} while (!safeParseState(getCurrentState({ history })));
} else {
resolve();
}
});
requestHistoryTick(() => {
silentFlag = true;
history.back();
});
}
}

@@ -586,10 +590,16 @@ },

const popCount = isRoot ? 0 : steps.length;
do {
for (let i = 0; i < popCount; i += 1) {
requestHistoryTick(() => {
for (let i = 0; i < popCount; i += 1) {
requestHistoryTick((resolve) => {
if (!safeParseState(getCurrentState({ history }))) {
silentFlag = true;
history.back();
});
}
} while (!safeParseState(getCurrentState({ history })));
} else {
resolve();
}
});
requestHistoryTick(() => {
silentFlag = true;
history.back();
});
}
}

@@ -596,0 +606,0 @@ }

@@ -6,3 +6,3 @@ import type { History } from "history";

export declare const makeHistoryTaskQueue: (history: History) => {
requestHistoryTick: (action: () => void, listen?: boolean | undefined) => void;
requestHistoryTick: (cb: (resolve: () => void) => void) => void;
};
{
"name": "@stackflow/plugin-history-sync",
"version": "1.3.15",
"version": "1.3.16",
"license": "MIT",

@@ -5,0 +5,0 @@ "exports": {

@@ -11,4 +11,3 @@ import type { History } from "history";

const requestHistoryTick: HistoryQueueContextValue["requestHistoryTick"] = (
cb: () => void,
listen: boolean = true,
cb,
) => {

@@ -18,14 +17,11 @@ previousTask = previousTask.then(

new Promise<void>((resolve) => {
if (listen) {
const clean = history.listen(() => {
clean();
resolve();
});
}
const clean = history.listen(() => {
clean();
resolve();
});
cb();
if (!listen) {
cb(() => {
clean();
resolve();
}
});
}),

@@ -32,0 +28,0 @@ );

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

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