@api-platform/client-generator
Version:
Generate apps built with Next, Nuxt, Quasar, React, React Native, Vue or Vuetify for any API documented using Hydra or OpenAPI
26 lines (20 loc) • 588 B
JavaScript
export default (initState, types) => ({
[ ](state) {
Object.assign(state, initState);
},
[ ](state, error) {
Object.assign(state, { error });
},
[ ](state) {
Object.assign(state, { isLoading: !state.isLoading });
},
[ ](state, retrieved) {
Object.assign(state, { retrieved });
},
[ ](state, updated) {
Object.assign(state, { error: '', updated, violations: null });
},
[ ](state, violations) {
Object.assign(state, { violations });
},
});