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

[FR] Export BaseModel at the module level #615

Open
FossPrime opened this issue Dec 13, 2021 · 0 comments
Open

[FR] Export BaseModel at the module level #615

FossPrime opened this issue Dec 13, 2021 · 0 comments

Comments

@FossPrime
Copy link
Contributor

FossPrime commented Dec 13, 2021

Description

BaseModel should be exported at the feathers-vuex module level so we can take advantage of the two step Js Module compilation.

Currently, we have to initialize feathers-vuex at runtime to get access to the static BaseModel. This is particularly helpful when you need to asynchronously fetch Feathers endpoint configuration from a server or a service worker cache and you can't synchronously initialize feathers-vuex.

Workaround

Initialize feathers-vuex twice... Once at compilation time with a throwaway server alias and a fake feathersClient instance, just to get the BaseModel to re-export, and then a second time at runtime with the real feathersClient for the Feathers-vuex you'll actually use.

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