Comments (5)
@ellipticaldoor I found a way around that specific problem, you currently can give specific namespaces to feathers-vuex before it clobbers your existing modules, you just need to do it in the initial call to feathers-vuex.
you can do it like this:
const feathersClient = feathers()
.configure(hooks())
.configure(socketio(socket))
.configure(auth({ storage: window.localStorage }))
.configure(rx(RxJS, {idField: '_id'}))
.configure(feathersVuex(store, {
idField: '_id',
auth: {
userService: '/users'
}
}, {
'messages': { namespace: 'feathersMessagesServiceModule' },
'users': { namespace: 'feathersUsersServiceModule' }
}))
or to illustrate the arguments to feathersVuex
better:
const feathersVuexOptions = {
idField: '_id',
auth: {
userService: '/users'
}
}
const feathersVuexModules = {
'messages': 'feathersMessagesServiceModule', // or { namespace: 'feathersMessagesServiceModule' },
'users': 'feathersUsersServiceModule' // or { namespace: 'feathersUsersServiceModule' }
}
const feathersClient = feathers()
.configure(hooks())
.configure(socketio(socket))
.configure(auth({ storage: window.localStorage }))
.configure(rx(RxJS, {idField: '_id'}))
.configure(feathersVuex(store, feathersVuexOptions, feathersVuexModules))
from feathers-vuex.
I've released the 1.0.0
beta, which include the ability to customize the store and fixes the "clobbering" of state, etc. Please check out the details here: #40. I'm closing this issue. Feel free to reopen after trying the new version, if needed.
from feathers-vuex.
Maybe feathers-vuex services can be prepended by and underscore or something like that?
Although a solution like this is not very elegant...
from feathers-vuex.
That's not the best because then it would make it more awkward for consumers to use in the simple example where they have no custom modules, etc.
One reason I thought about this issue was that I find the current solution with the customActions, etc added to the options passed to the service or the global modules options to be awkward and hard to maintain.
Right now to use feathers-vuex alongside existing custom modules or to integrate it with existing actions/getters/mutations/state, we have to migrate all of our existing store logic moving out of the clean structure dictated by vuex and into wherever we are calling the feathersVuex plugin.
I want to be able to manage the rest of my store as normal and then slowly add logic that exposes or integrates the actions/getters/mutations/state that feathers-vuex builds for my services.
from feathers-vuex.
Maybe you can rename the modules that you already have until you fully migrate to this solution.
Other problem is that you have to be careful of not naming a store module like one of your services.
from feathers-vuex.
Related Issues (20)
- Any future plans to support Pinia or Vuex 5 stores? HOT 1
- ReplaceItems option doesn't works when patching/updating value with null HOT 2
- Potential Issue with Params.Paginate set to true HOT 1
- FeathersVuexGet component doesn't work with params HOT 1
- add one time sponsor HOT 2
- makeFindMixin uses the same object instance for data HOT 2
- $like operator not working in local getters(using sequelize) HOT 2
- $sort when field data is NULL HOT 4
- Performance issue Find with more than 500 records HOT 18
- Recommended way to use feathers-graph-populate with feathers-vuex auth system
- Auth plugin fails to generate the getters when userService contains a path-like name, e.g 'v1/users'
- [FR] Export BaseModel at the module level
- Keycloak / feathers server and client library HOT 4
- TypeError: Cannot read properties of undefined (reading 'set')
- FeathersVuexPagination does not work with vue 3
- Simple date filter from store not working
- auth user is not updated reactively
- Supporting Vue 2.7 HOT 1
- JWT Malformed error
- Do not clean clone after save inside feathersVuexFormWrapper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from feathers-vuex.