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

refactor(service): Use type predicate in rxjs filter #150

Merged

Conversation

LeonFretter
Copy link
Contributor

What is this PR about

This uses a type predicate inside the rxjs filter, in the detectRouteChanges of the service.
That makes typescript aware of the event's type, so that subsequently the type doesn't have to be checked again.

(I've checked the boxes below, as it's only a refactor, not a fix/feature.

PR Checklist

Please check if your PR fulfils the following requirements:

  • The commit message follows the guidelines
  • Tests for the changes have been added (for bug fixes/features)
  • Docs have been added/updated (for bug fixes/features)

Copy link
Owner

@udayvunnam udayvunnam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, @LeonFretter. This is a good way to avoid multiple checks on js

@udayvunnam udayvunnam merged commit 41973f7 into udayvunnam:main Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants