Skip to content

Commit

Permalink
fix(resourceModule): let state return a function
Browse files Browse the repository at this point in the history
This addresses the `'state' should be a method that returns an object` warning I encountered on a nuxt project. The Vuex documentation over at https://vuex.vuejs.org/guide/modules.html#module-local-state does also use a method for the `state` when building the local state of the example module.
  • Loading branch information
Volker Rose authored and Josh Justice committed Oct 15, 2020
1 parent e44891c commit 03fe023
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/reststate-vuex.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ const resourceModule = ({ name: resourceName, httpClient }) => {
return {
namespaced: true,

state: initialState(),
state: initialState,

mutations: {
REPLACE_ALL_RECORDS: (state, records) => {
Expand Down

0 comments on commit 03fe023

Please sign in to comment.