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

Any interest in updating to Vue 3? #29

Open
DanHulton opened this issue Sep 29, 2021 · 1 comment
Open

Any interest in updating to Vue 3? #29

DanHulton opened this issue Sep 29, 2021 · 1 comment

Comments

@DanHulton
Copy link

This is one of my favourite Vue plugins, really makes it a lot easier to display custom loading states for multiple elements, and I'd be sad if I had to leave it behind for Vue 3.

I tried to take a stab at it myself, but I'm really slowed down by my lack of Typescript knowledge, so I imagine it might be much quicker if done by, say, someone who knew Typescript.

So far, I've changed it so that LoadableMixin returns an object, not a Vue.extend(), and changed install to work like:

export function install(app: VueConstructor): void {
  app.mixin(LoadableMixin);
}

However, the way I want to use it is using Vue3's composition API, like so:

const createProject = loadable((values) => store.dispatch('Projects/createProject', values));

The problem I'm running into is that loadable relies on this, and the context of the current component isn't passed in there. I think it probably requires some clever .bind() calls, though I'm not sure where and this is where my lack of TS knowledge is really hampering me.

@DanHulton
Copy link
Author

For others looking for a Vue3 version, I've used this package as inspiration to create vue-is-loading, which works essentially the same.

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

1 participant