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

useLoading is not consistent with other plugins #106

Open
IGx89 opened this issue Aug 12, 2022 · 1 comment
Open

useLoading is not consistent with other plugins #106

IGx89 opened this issue Aug 12, 2022 · 1 comment
Assignees

Comments

@IGx89
Copy link

IGx89 commented Aug 12, 2022

Hello! First off, thanks a lot for this useful plugin :). Wanted to bring your attention to a behavior difference in your useLoading implementation vs. other plugins (such as vue-router's useRouter). Your useLoading methods creates a brand new instance, separate from what was globally installed, while other plugins simply call inject to get the global instance (example). That means if I want to use the global instance, with all the configuration options I set, I have to do this instead:

const loading = inject("$loading") as PluginApi;

I'd recommend changing it to just be a wrapper around inject, preventing duplicate instances and avoiding confusing situations such as what I ran into, where global configs strangely didn't have any effect.

@ankurk91
Copy link
Owner

Thanks, i will look into it.

@ankurk91 ankurk91 self-assigned this Aug 12, 2022
@ankurk91 ankurk91 changed the title useLoading not consistent with other plugins useLoading is not consistent with other plugins Aug 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants