-
Notifications
You must be signed in to change notification settings - Fork 135
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Delay initialization (lazy loading) #637
Conversation
silesky
commented
Oct 24, 2022
•
edited
Loading
edited
🦋 Changeset detectedLatest commit: b66c10f The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
bb8b8ab
to
6d6dd29
Compare
6d6dd29
to
22de419
Compare
751759a
to
a67cfc2
Compare
I'm curious wouldn't this have worked anyway? We've always buffered up events until |
634ad90
to
c1dbc13
Compare
c1dbc13
to
0894ef2
Compare
} | ||
|
||
/** | ||
* Starts loading an analytics instance including: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add a note that this should only be called once? Want to make it clear that calling this with different settings won't essentially 'reload' analytics.
/** | ||
* Return a promise that can be externally resolved | ||
*/ | ||
export const createDeferred = <T>() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a better name than extractPromiseParts
😁
@@ -53,6 +53,29 @@ document.body?.addEventListener('click', () => { | |||
}) | |||
``` | |||
|
|||
## Lazy / Delayed Loading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adding this section!
8cce6d2
to
754e74c
Compare