@tanstack/history
Advanced tools
Comparing version 1.61.1 to 1.81.3
@@ -7,4 +7,8 @@ export interface NavigateOptions { | ||
length: number; | ||
subscribers: Set<() => void>; | ||
subscribe: (cb: () => void) => () => void; | ||
subscribers: Set<(opts: { | ||
location: HistoryLocation; | ||
}) => void>; | ||
subscribe: (cb: (opts: { | ||
location: HistoryLocation; | ||
}) => void) => () => void; | ||
push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void; | ||
@@ -11,0 +15,0 @@ replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void; |
@@ -19,3 +19,3 @@ const pushStateEvent = "pushstate"; | ||
location = opts.getLocation(); | ||
subscribers.forEach((subscriber) => subscriber()); | ||
subscribers.forEach((subscriber) => subscriber({ location })); | ||
}; | ||
@@ -22,0 +22,0 @@ const tryNavigation = async (task, navigateOpts) => { |
{ | ||
"name": "@tanstack/history", | ||
"version": "1.61.1", | ||
"version": "1.81.3", | ||
"description": "Modern and scalable routing for React applications", | ||
@@ -5,0 +5,0 @@ "author": "Tanner Linsley", |
@@ -11,4 +11,4 @@ // While the public API was clearly inspired by the "history" npm package, | ||
length: number | ||
subscribers: Set<() => void> | ||
subscribe: (cb: () => void) => () => void | ||
subscribers: Set<(opts: { location: HistoryLocation }) => void> | ||
subscribe: (cb: (opts: { location: HistoryLocation }) => void) => () => void | ||
push: (path: string, state?: any, navigateOpts?: NavigateOptions) => void | ||
@@ -78,3 +78,3 @@ replace: (path: string, state?: any, navigateOpts?: NavigateOptions) => void | ||
let location = opts.getLocation() | ||
const subscribers = new Set<() => void>() | ||
const subscribers = new Set<(opts: { location: HistoryLocation }) => void>() | ||
let blockers: Array<BlockerFn> = [] | ||
@@ -84,3 +84,3 @@ | ||
location = opts.getLocation() | ||
subscribers.forEach((subscriber) => subscriber()) | ||
subscribers.forEach((subscriber) => subscriber({ location })) | ||
} | ||
@@ -114,3 +114,3 @@ | ||
subscribers, | ||
subscribe: (cb: () => void) => { | ||
subscribe: (cb: (opts: { location: HistoryLocation }) => void) => { | ||
subscribers.add(cb) | ||
@@ -117,0 +117,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
73573
1008