direct-vuex icon indicating copy to clipboard operation
direct-vuex copied to clipboard

[Feature request] Add support for lazy loading modules

Open lyle45 opened this issue 3 years ago • 6 comments

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

lyle45 avatar Mar 07 '21 17:03 lyle45

They still can be added to the original vuex store…

paleo avatar Apr 20 '21 16:04 paleo

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

lyle45 avatar Apr 21 '21 06:04 lyle45

@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

lyle45 avatar Apr 21 '21 07:04 lyle45

@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.

paleo avatar Apr 21 '21 08:04 paleo

@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

lyle45 avatar Apr 21 '21 08:04 lyle45

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

paleo avatar Apr 21 '21 08:04 paleo