@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
22 lines (17 loc) • 468 B
JavaScript
export default (initState, types) => ({
[types.SET_ERROR](state, error) {
Object.assign(state, { error });
},
[types.TOGGLE_LOADING](state) {
Object.assign(state, { isLoading: !state.isLoading });
},
[types.SET_CREATED](state, created) {
Object.assign(state, { created });
},
[types.SET_VIOLATIONS](state, violations) {
Object.assign(state, { violations });
},
[types.RESET](state) {
Object.assign(state, initState);
},
});