Skip to content
Discussion options

You must be logged in to vote

the problem is I dont know how to define multiple mutations for my states in this format of usage :
export const updateDrawerState = (state) => { state.drawerState = !state.drawerState; };

It turned out that the OP actually wants to know how to define multiple mutations, and here is the answer:

// The guide shows a similar mutation
export const toggleDrawerState = (state) => {
  state.drawerState = !state.drawerState;
};

// So, just add more of them if you want to add more of them, ? :)
export const resetWhatever = (state) => {
  state.whatever = 'hehehe';
};

// With a payload
export const setWhatever = (state, value) => {
  state.whatever = value === 'hehehe' ? value : value.toLowerCase

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@amirsafaricg
Comment options

@SergioAndreev
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by yusufkandemir
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
5 participants