Is it possible to separate pinia actions into two distinct namespaces, allowing access through properties n1 and n2 like this:
// current
store.n1a('hi')
store.n2b()
// wanted
store.n1.a('hi')
store.n2.b()
// cumbersome workaround:
store.namespace1().a('hi')
// store structure would resemble
actions: {
namespace1() {
return {
a(msg) {
console.log(msg);
},
};
....
},
},
This approach greatly enhances the clarity of function naming, such as bath.paint() and kitchen.paint() instead of bathPaint(), etc. A similar concept can be found here: https://vuejs.org/api/options-state.html#expose