I am creating a messaging component with Vue2 and Im currently plling every 30 seconds for any new messages and if there are message they will be automaically inserted into the relevant threads, my question is, can I detect when the data changes (e.g. a new message has been added.

The reason I want to do this, is because I want to flash an icon when a new message gets added to a conversation.

Here is the relevant parts of my code:

```
poll_messages(){
    this.get_messages();
    this.interval = setInterval(() => {
        this.get_messages();
    }, 30000);
},
get_messages(){
    $.get(base_url + 'api_messages/get_messages/', (data) => {
        this.threads = data;
    });

},

```

So if the threads variable changes I want to know. Is this possible?