register model at runtime#511
Conversation
|
Ahh... yeah. That getter is so we can do Looking into Vuex doc, maybe there's no way to add extra getters after store initialization... As you mentioned, it's not documented so maybe we can just remove that functionality. Do you think you can remove the test for that getter and make this PR pass? Thank you so much for the PR by the way! 🎉 |
removed shorthand store.getters['entities/users']() for accessing query object of the model use the long version instead: store.getters['entities/users/query']()
Codecov Report
@@ Coverage Diff @@
## master #511 +/- ##
=====================================
Coverage 100% 100%
=====================================
Files 47 47
Lines 1798 1812 +14
Branches 250 252 +2
=====================================
+ Hits 1798 1812 +14
Continue to review full report at Codecov.
|
| const database = new Database() | ||
|
|
||
| database.register(User) | ||
| database.register(Hobby) // TODO custom module? |
There was a problem hiding this comment.
@kiaking
What do you think about testing this functionality with adding a custom module?
|
@SzNagyMisu Hi sorry for my late response! Do you think you can resolve the conflict...!? |
|
Wow... Things have changed since... I'll give it a try |
|
I've decided it will be cleaner if I start the whole PR from scratch - so many things have changed since. |
|
Reopened PR at #535 - closing this one. |
PR for #187
90% done - stuck with remaining 10%...
I can register a brand new module into vuex (like
'entities/hobbies') but cannot add a new getter under an existing module (like the namespaced getter'hobbies'under the module'entities').See L44-L46 in
ModuleBuilder.createModules()vuex-orm/src/modules/builder/Builder.ts
Lines 35 to 56 in a48dea1
Any ideas?
@kiaking what are that gettters for? I don't remember having met them in the docs or during coding.