-
Notifications
You must be signed in to change notification settings - Fork 60
Add Vuex 2.0 Deprecations (lower priority, as upgrading to Vuex 2.0 is optional for Vue 2) #2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
List updated 😄 |
@ktsn Thanks! These look great! |
@ktsn How would you feel about having all the migration info in the main guide, but on a separate |
Sounds good to me. |
For the |
@mckaydavis Planning on it. 😃 👍 |
Can you add the change in actions as well? Vuex 1 Example: export const addToCart = ({ dispatch, state }, product, foo, bar) => {
// Use product, foo, bar.
} Vuex 2 Example: export const addToCart = ({ commit, state }, payload) => {
// Use payload.product, payload.foo, payload.bar.
} |
@TheDutchCoder Yes, we should be able to catch that! |
Closing, as the tool already migrates people to a minimal version of Vuex that allows them to use Vue 2, which is the primary purpose of the tool. |
Patterns:
vuex: {
should be replaced by action/mutation/getter/state helpers on methods and computed propertiesstore.watch('XXX', ...)
->store.watch(state => state.XXX, ...)
The 1st argument ofwatch
should be the function that returns sub state tree.middlewares
->plugins
store.dispatch
->store.commit
mutations are now triggered bycommit
method.store.dispatch
andstore.commit
is no longer variadic. It now accepts a single payload value as the 2nd argument.silent
flag for silent dispatch is now declared in 3rd argument options object.The text was updated successfully, but these errors were encountered: