Socket
Socket
Sign inDemoInstall

@tanstack/history

Package Overview
Dependencies
Maintainers
2
Versions
181
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tanstack/history - npm Package Compare versions

Comparing version 1.49.0 to 1.49.7

1

dist/esm/index.d.ts

@@ -18,2 +18,3 @@ export interface NavigateOptions {

notify: () => void;
_ignoreSubscribers?: boolean;
}

@@ -20,0 +21,0 @@ export interface HistoryLocation extends ParsedPath {

13

dist/esm/index.js

@@ -131,4 +131,9 @@ const pushStateEvent = "pushstate";

}
const caller = next.isPush ? originalPushState : originalReplaceState;
caller.call(win.history, next.state, "", next.href);
history._ignoreSubscribers = true;
(next.isPush ? win.history.pushState : win.history.replaceState)(
next.state,
"",
next.href
);
history._ignoreSubscribers = false;
next = void 0;

@@ -187,3 +192,3 @@ scheduled = void 0;

const res = originalPushState.apply(win.history, args);
onPushPop();
if (!history._ignoreSubscribers) onPushPop();
return res;

@@ -193,3 +198,3 @@ };

const res = originalReplaceState.apply(win.history, args);
onPushPop();
if (!history._ignoreSubscribers) onPushPop();
return res;

@@ -196,0 +201,0 @@ };

{
"name": "@tanstack/history",
"version": "1.49.0",
"version": "1.49.7",
"description": "Modern and scalable routing for React applications",

@@ -5,0 +5,0 @@ "author": "Tanner Linsley",

@@ -22,2 +22,3 @@ // While the public API was clearly inspired by the "history" npm package,

notify: () => void
_ignoreSubscribers?: boolean
}

@@ -242,6 +243,15 @@

// We use the original push/replace calls here to ensure that
// we do not notify subscribers about this push/replace call
const caller = next.isPush ? originalPushState : originalReplaceState
caller.call(win.history, next.state, '', next.href)
// We need to ignore any updates to the subscribers while we update the browser history
history._ignoreSubscribers = true
// Update the browser history
;(next.isPush ? win.history.pushState : win.history.replaceState)(
next.state,
'',
next.href,
)
// Stop ignoring subscriber updates
history._ignoreSubscribers = false
// Reset the nextIsPush flag and clear the scheduled update

@@ -321,3 +331,3 @@ next = undefined

const res = originalPushState.apply(win.history, args)
onPushPop()
if (!history._ignoreSubscribers) onPushPop()
return res

@@ -328,3 +338,3 @@ }

const res = originalReplaceState.apply(win.history, args)
onPushPop()
if (!history._ignoreSubscribers) onPushPop()
return res

@@ -331,0 +341,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

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