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

Nothing prevents calling forRoot several times #81

Closed
1 of 2 tasks
HunteRoi opened this issue Jun 10, 2021 · 4 comments
Closed
1 of 2 tasks

Nothing prevents calling forRoot several times #81

HunteRoi opened this issue Jun 10, 2021 · 4 comments

Comments

@HunteRoi
Copy link
Contributor

HunteRoi commented Jun 10, 2021

I'm submitting a ...

  • bug report => search github for a similar issue or PR before submitting
  • feature request

Current behavior
When you build your application, if you misconfigure the application by calling NgxSkeletonLoaderModule.forRoot() at several places, nothing is returned to the developer saying they should avoid it.

Expected behavior
An error in dev mode to tell the developer not to configure the module several times in their application.

Reproduction of the problem

  1. create a project
  2. npm i ngx-skeleton-loader
  3. create a submodule and add NgxSkeletonLoaderModule.forRoot() to its imports array
  4. do the same with the application's main module (AppModule)

What is the motivation / use case for changing the behavior?
#77 (comment)
#77 (comment)

@HunteRoi
Copy link
Contributor Author

Hey there, @willmendesneto ! I hope you are doing great.

Do you plan to make a move to solve this issue without any breaking change in the current behavior of the library?

Cheers! 🍻

@willmendesneto
Copy link
Owner

Hey @HunteRoi . No plans at the moment, unfortunately. I'm kinda busy these days and I won't be able to work directly on this issue, but I'm happy to support and review any code changes if you're keen to raise a pull request.

@willmendesneto
Copy link
Owner

@HunteRoi Sharing some updates on this one:

Unfortunately, the idea of having it without breaking changes won't be possible, indeed. This is because the module loads more than once even if added & loaded in a shared module async. So, the safest way to make sure consumers won't face this issue in production is by throwing an error.

I'm working on it and a new version will be published soon

@willmendesneto
Copy link
Owner

Some good news: the issue was solved and I just published a new version of ngx-skeleton-loader with that. Please update your project to use ngx-skeleton-loader@3.0.0 to use the latest changes in your project 🚀

Closing this issue. Thanks @HunteRoi for raising that!

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

No branches or pull requests

2 participants