Created
December 24, 2020 14:03
-
-
Save YonathanMeguira/0b8b95b212d0c6fe4300fe83550132cb to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const event = fromEvent(window, 'storage || onStorage') | |
.pipe(filter((values: any[]) => // get right key, filter); | |
// returns the value of amplitude in local storage | |
event.pipe(pairwise(), take(1)).subscribe(([prev, curr]) => { | |
if (prev && !curr) { | |
// amplitude just sent all the events | |
sendEventsFromSession() | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment