mixpanel-js
mixpanel-js copied to clipboard
Support lazy loading module
Hi there.
I just tried use lazy loading with this lib and got an issue.

(async () => {
const mixpanel = await import('mixpanel-browser');
this.mixpanel.init(TOKEN, {debug: true})
this.mixpanel.identify(ID) <--- exception here.
})();
Seems like the problem was in the init function.
(async() => {
const module = await import('mixpanel-browser');
const mixpanel = module.init(TOKEN, {debug: true}, 'test'); <-- name is important
})()