It’s possible in react to create multi-store files and the group them in one single file? something like redux… or you suggest go with redux instead of f7 defaults’ store?
Thanks.
// module-a.js
export const moduleA = {
state: {
fooA: 'a',
barA: 'b',
},
getters: {
getterFooA({state}) {
return state.fooA;
},
getterBarA({state}) {
return state.barA;
},
},
actions: {
actionA1() {
// ...
},
actionA2() {
// ...
}
}
}
// module-b.js
export const moduleB = {
state: {
fooB: 'a',
barB: 'b',
},
getters: {
getterFooB({state}) {
return state.fooB;
},
getterBarB({state}) {
return state.barB;
},
},
actions: {
actionB1() {
// ...
},
actionB2() {
// ...
}
}
}
// store
import moduleA from 'path/to/module-a.js';
import moduleB from 'path/to/module-b.js'
const store = createStor({
state: {
...moduleA.state,
...moduleB.state,
},
getters: {
...moduleA.getters,
...moduleB.getters,
},
actions: {
...moduleA.actions,
...moduleB.actions,
}
});
Thanks.
Does the f7 store have the same power of redux or other libraries?