Skip to content

Instantly share code, notes, and snippets.

@k1r0s
Created March 21, 2017 14:57
Show Gist options
  • Save k1r0s/f62411cd56476db9307c022743f7cff3 to your computer and use it in GitHub Desktop.
Save k1r0s/f62411cd56476db9307c022743f7cff3 to your computer and use it in GitHub Desktop.
This is an example of what we normaly do in OOP
class Invoice {
...
doCheckout(shippingDetails){
if(this.validate(shippingDetails)){
this.shippingDetails = shippingDetails
var serializedInstance = JSON.stringify(this)
$OurAjaxService.post({
url: this.url,
data: serializedInstance
}).then((response) => {
//...notify the user or something, trigger the state
})
}
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment