paroi-tech / direct-vuex

Use and implement your Vuex store with TypeScript types. Compatible with the Vue 3 composition API.
Creative Commons Zero v1.0 Universal
258 stars 14 forks source link

[Feature request] Add support for lazy loading modules #68

Open lyle45 opened 3 years ago

lyle45 commented 3 years ago

Add support for lazy loading vuex modules and adding them to the direct store. Not sure how Typescript would work in those cases or even of its possible, but this would be needed either way

paleo commented 3 years ago

They still can be added to the original vuex store…

lyle45 commented 3 years ago

@paleo true but could i access them directly or would i need to use magic string?

lyle45 commented 3 years ago

@paleo maybe typescript type imports can be used here for optional modules? https://davidea.st/articles/typescript-2-9-import-types

Edit: Couldn't find information about this feature in newer version of TS so I'm not sure it was continued... Would've been good for this though

paleo commented 3 years ago

@paleo true but could i access them directly or would i need to use magic string?

The original Vuex string system would be needed.

Maybe a solution could be to implement the runtime part only, without typing. In order to dynamically generate the wrappers after the initialization. But I'm unsure of how it can be useful.

Additionally, I don't plan to work on this package except for bug fix. Because the future Vuex 5 will make it obsolete.

lyle45 commented 3 years ago

@paleo

Additionally, I don't plan to work on this package except for bug fix. Because the future Vuex 5 will make it obsolete.

Ouch that is sad to hear for now. While true, Vuex 5 will take a really long time to become mainstream while even vuex 4 is still @next

That should be written in Readme

paleo commented 3 years ago

… but I'll accept pull requests with useful new features.