Skip to content

Commit

Permalink
feat: Name patched functions for better stack traces
Browse files Browse the repository at this point in the history
  • Loading branch information
franky47 committed Sep 11, 2023
1 parent aa0619b commit 5b7c494
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ export function usePatchedHistory() {
}
for (const method of ['pushState', 'replaceState'] as const) {
const original = window.history[method].bind(window.history)
window.history[method] = (
window.history[method] = function nextUseQueryState_patchedHistory(
state: any,
marker: string,
url?: string | URL | null
) => {
) {
// If someone else than our hooks have updated the URL,
// send out a signal for them to sync their internal state.
if (marker !== NOSYNC_MARKER && url) {
Expand Down

0 comments on commit 5b7c494

Please sign in to comment.