You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a specific motivator for this RFC. When the enableAutoPageviews is called multiple times inadvertently by the library client, it registers multiple listeners on the pushState API and starts sending duplicate events.
It would be easy to avoid this mistake by storing some information on the window object and making any further calls to enableAutoPageviews act as a no-op.
Nice to have: in development mode, we should console.warn about using the library in an unintended way.
This begs two questions:
Is there any concern with making the library act as a singleton? Put in other words, can registering multiple listeners for pushState and popState by this library ever be considered a feature not a bug?
Is there some sort of common API to tell bundlers to elide some warnings or code in production mode as opposed to development mode? Can NODE_ENV be used for that?
The text was updated successfully, but these errors were encountered:
There is a specific motivator for this RFC. When the
enableAutoPageviews
is called multiple times inadvertently by the library client, it registers multiple listeners on thepushState
API and starts sending duplicate events.It would be easy to avoid this mistake by storing some information on the
window
object and making any further calls toenableAutoPageviews
act as a no-op.Nice to have: in development mode, we should
console.warn
about using the library in an unintended way.This begs two questions:
pushState
andpopState
by this library ever be considered a feature not a bug?NODE_ENV
be used for that?The text was updated successfully, but these errors were encountered: