question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can I $watch whole $data but except some properties?

See original GitHub issue

See the code here:

new Vue({
    el: '#x',
    data: {
        prop1 : '',
        prop2 : '',
        ...
        result : ''
    },
    ready: function(){
        this.$watch('$data', function(){
            this.load(function( xx ){
                // # This will cause '$data change' again, then do 'load' again, infinity looping...
                this.result = xx;
                // /
                // So, can I watch the whole $data but except the 'result'?
            });
        });
    },
    methods: {
        load: function( callback ){
            var self = this;
            doSomeAsync(function( xx ){
                callback.call(self, xx);
            });
        }
    }
});

Did I use it in the right way?

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
asipcommented, Jul 15, 2014
0reactions
Alexorzcommented, Jul 15, 2014

@asip , the key problem: addcalculate is an async function in my case.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ignore some properties in a deep watch for VueJs
I considered creating a computed property to watch that doesn't include the isSelected field but that seems like a lot of overhead to...
Read more >
Is there a way of getting all data attributes except one?
i want to send a post axios request with all my data attributes except for one (as it is a very big array...
Read more >
Introduction to tables
In an Access database, table properties are attributes of a table that affect the appearance or behavior of the table as a whole....
Read more >
[UA→GA4] Comparing metrics: Google Analytics 4 vs ...
Your UA reports may be excluding data based on filters. GA4 properties currently do not support these filters. Pageviews. In general, Pageviews should...
Read more >
FAQ: Creating variables recording properties of the other ...
egen, count() by() is also often useful but is a little less general in application, so we will concentrate here on total(). total()...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found