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

remove ionic overlay workaround and make login controller cleaner #427

Conversation

captaincaius
Copy link
Contributor

Good news - ionic's overlays seem to be test-friendly now!

  1. got rid of the mix of promises and rxjs in login controller. But after making it as clean and readable as Luiza suggested, I sacrificed a little readability to ensure that the API request goes in parallel to the loading overlay, uh, loading :P. Please let me know if you folks would prefer to prioritize readability instead.

  2. please notice I snuck in a little memory leak fix into this commit by navigating based on the route snapshot instead of subscribing. Hope that's ok.

@captaincaius
Copy link
Contributor Author

darn... just looked at the changes... I meant to apply that declarative unsubscribe thing on the observable so a real request will be aborted if the user navigates away but I forgot :-/.

@captaincaius
Copy link
Contributor Author

request abort added to PR

Copy link
Member

@sinedied sinedied left a comment

Choose a reason for hiding this comment

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

Looks good!

Following your e2e changes, it might be interesting to migrate all promise code from service/components to async await 😃 (I know @captaincaius your initial Ionic PR had it, it might be time to resurrect this and complete the remaining work everywhere else).
But let's keep this in a separate PR, I've created #429 to follow

@captaincaius
Copy link
Contributor Author

haha you were right though... it was sneaky of me to creep it into that PR :P my bad

@sinedied sinedied merged commit 6c8011d into ngx-rocket:release/6.0.x Jan 21, 2019
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