Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

vuex add multiple payload to mutation

// call
store.commit('authenticate', {
    token,
    expiration,
});

// mutation
mutations: {
    authenticate(state, { token, expiration }) {
        localStorage.setItem('token', token);
        localStorage.setItem('expiration', expiration);
    }
}
Comment

PREVIOUS NEXT
Code Example
Javascript :: forloop in js 
Javascript :: javascript regex generator 
Javascript :: javascript sort numbers 
Javascript :: pyspark from_json example 
Javascript :: javascript canvas grayscale 
Javascript :: jquery fadeout and remove 
Javascript :: regex find string between two characters 
Javascript :: react and react dom cdn 
Javascript :: js select div 
Javascript :: index.js:3 Uncaught ReferenceError: $ is not defined at index.js:3 
Javascript :: react native floating button 
Javascript :: [PrivateRoute] is not a <Route component. All component children of <Routes must be a <Route or <React.Fragment 
Javascript :: javascript count time 
Javascript :: array map limit javascript 
Javascript :: how to cache data in javascript 
Javascript :: iterate through json object 
Javascript :: flatten an array without using .flat(); 
Javascript :: for in 
Javascript :: custom event js 
Javascript :: javascript enum 
Javascript :: gatsby new 
Javascript :: url regular expression 
Javascript :: jquery hover event 
Javascript :: handlerbar console log 
Javascript :: Odd number function in javascript 
Javascript :: syntax function 
Javascript :: how to push array into array in angular 
Javascript :: jquery dropdown select 
Javascript :: js and 
Javascript :: reactstrap form post 
ADD CONTENT
Topic
Content
Source link
Name
4+9 =