Skip to content

Commit

Permalink
fix types
Browse files Browse the repository at this point in the history
  • Loading branch information
danieljackins committed Aug 1, 2023
1 parent d4dca8d commit 92e118c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/browser/src/lib/on-page-change.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*
* adapted from https://stackoverflow.com/questions/3239834/window-onbeforeunload-not-working-on-the-ipad/52864508#52864508,
*/
export const onPageChange = (cb: (...args: boolean[]) => void) => {
export const onPageChange = (cb: (unloaded: boolean) => void) => {
let unloaded = false // prevents double firing if both are supported

window.addEventListener('pagehide', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function batch(
}, timeout)
}

onPageChange((unloaded: boolean) => {
onPageChange((unloaded) => {
pageUnloaded = unloaded

if (pageUnloaded && buffer.length) {
Expand Down

0 comments on commit 92e118c

Please sign in to comment.