How do I check if the current data set is dirty?
I want to do a quick check before posting the data. Given the following code snippet as an example:
save: function(e) {
if(~~insert dirty check here~~) {
$.ajax(e.currentTarget.action, {
type: this.method,
data: {
_method: this.method,
_token: this.token,
data: JSON.stringify(this.card_data)
}
}).done($.proxy(function(content) {
this.card_data = content;
this.mode = 'view';
}, this));
}
}
It doesn't seem like Vue.js uses any dirty checking.
Vue.js is able to deliver the plain JavaScript object syntax without resorting to dirty checking by using Object.defineProperty, which is an ECMAScript 5 feature. It only works on DOM elements in IE8 and there's no way to polyfill it for JavaScript objects.
Source: https://github.com/vuejs/vue/wiki/FAQ
Vue.js has better performance because it doesn't use dirty checking.
Source: https://github.com/vuejs/vue/issues/96#issuecomment-35052704
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With