feathersjs-ecosystem / feathers-vuex

Integration of FeathersJS, Vue, and Nuxt for the artisan developer

Home Page:https://vuex.feathersjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[FR] Export BaseModel at the module level

FossPrime opened this issue · comments

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.