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

perf(providers): make sure all services are singleton #610

Merged
merged 3 commits into from
May 24, 2017

Conversation

emoralesb05
Copy link
Contributor

when using modules, make sure we reuse the instance provided by the parent module rather than creation a new instance.

all covalent services are meant to be singleton and app wise instances.

What's included?

  • Added provider factories to either return the parent instance or create one if there is none.

Test Steps

  • ng serve
  • See all components working fine.
  • To verify this works, you would need to import a module that has a service like http or media in app.module and then import it again in a submodule. You can see they will share the instance using augury

General Tests for Every PR

  • ng serve --aot still works.
  • npm run lint passes.
  • npm test passes and code coverage is not lower.
  • npm run build still works.

when using modules, make sure we reuse the instance provided by the parent module rather than creation a new instance.

all covalent services are meant to be singleton and app wise instances.
@emoralesb05 emoralesb05 added this to the Beta.5 milestone May 22, 2017
@emoralesb05 emoralesb05 merged commit 4544c1a into develop May 24, 2017
@emoralesb05 emoralesb05 deleted the feature/reuse-provider-instance branch May 24, 2017 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant