Skip to content
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

Better types for EventMessage #7208

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Conversation

vezaynk
Copy link

@vezaynk vezaynk commented Jul 17, 2024

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_OPENED payload type. Im guessing its PopupEvent?
  • 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.

@vezaynk vezaynk marked this pull request as ready for review July 17, 2024 21:47
@vezaynk vezaynk requested a review from tnorling as a code owner July 17, 2024 21:47
@vezaynk
Copy link
Author

vezaynk commented Jul 18, 2024

@microsoft-github-policy-service agree company="Penn Interactive Ventures, LLC"

@vezaynk
Copy link
Author

vezaynk commented Jul 29, 2024

@tnorling Could I have some 👀 on this?

Copy link
Contributor

Reminder: This PR appears to be stale. If this PR is still a work in progress please mark as draft.

@microsoft-github-policy-service microsoft-github-policy-service bot added the Needs: Attention 👋 Awaiting response from the MSAL.js team label Aug 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs: Attention 👋 Awaiting response from the MSAL.js team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant