Better types for EventMessage
Improving typings via union types that correlate between events and payloads.
Based on https://github.com/AzureAD/microsoft-authentication-library-for-js/blob/dev/lib/msal-browser/docs/events.md
That doc seems somewhat outdated
- Missing
POPUP_OPENEDpayload type. Im guessing itsPopupEvent? - Remove
ACTIVE_ACCOUNT_CHANGED,INITIALIZE_START,INITIALIZE_END
This allows for TypeScript to refine types based on the eventType property, and match the correct payload type automatically.
Please review to make sure I got it right.
@microsoft-github-policy-service agree company="Penn Interactive Ventures, LLC"
@tnorling Could I have some 👀 on this?
Thanks for the suggestion, unfortunately the proposed changes aren't compatible anymore with some changes we've made since and to do this right may require some breaking changes. I'm going to close this but I agree this is a nice to have, I've opened an item on our internal backlog to see what we can do here to make this better in the future.