Skip to content

Instantly share code, notes, and snippets.

@theotherzach
Last active June 20, 2016 15:22
Show Gist options
  • Save theotherzach/d7095f8cd1b3f6fe06b5f8d73d39668e to your computer and use it in GitHub Desktop.
Save theotherzach/d7095f8cd1b3f6fe06b5f8d73d39668e to your computer and use it in GitHub Desktop.
export default {
computed: {
isFormValid() {
return this.$validator.valid && this.customerAddress.$dirty
}
canSave() {
return this.isFormValid && this.customerAddress.$notBusy
}
}
}
<address-form customer-address.local=`/addresses/${$params.email}`></address-form>
saveAddress(store, addressParams) {
return $http({
action: "PUT",
url: "blah",
}).then(function () {
store.dispatch("ADDRESS_SAVED")
return new Promise(res => res())
}, function () {
return new Promise(null, err => err())
})
}
import Addresses from './vxa/addresses'
export default {
state: {
addresses: new Addresses()
}
}
import VuexAsync from 'vuex-async'
export class Addresses {
static path: 'addresses'
constructor() {
this.$vxa = new VuexAsync
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment