Last active
June 20, 2016 15:22
-
-
Save theotherzach/d7095f8cd1b3f6fe06b5f8d73d39668e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default { | |
computed: { | |
isFormValid() { | |
return this.$validator.valid && this.customerAddress.$dirty | |
} | |
canSave() { | |
return this.isFormValid && this.customerAddress.$notBusy | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<address-form customer-address.local=`/addresses/${$params.email}`></address-form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | |
}) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Addresses from './vxa/addresses' | |
export default { | |
state: { | |
addresses: new Addresses() | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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