Skip to content

Instantly share code, notes, and snippets.

@iamshouvikmitra
Created August 8, 2021 07:04
Show Gist options
  • Save iamshouvikmitra/e904443e00866a75cc04e7409ea3df37 to your computer and use it in GitHub Desktop.
Save iamshouvikmitra/e904443e00866a75cc04e7409ea3df37 to your computer and use it in GitHub Desktop.
Function Invocation Pattern with Inner Functions
const url = "https://nvgs.com/analytics";
const data = JSON.stringify({
event: "checkout",
time: performance.now()
});
navigator.sendBeacon(url, data);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment