Questions tagged [watch]

Watch refers to observing the status of variables, files or directories for some or all possible actions such as additions, deletions or modifications.

Watch refers to observing the status of variables, files or directories for some or all possible actions such as additions, deletions or modifications.

1673 questions
46
votes
4 answers

Watch route object in VueJS 2

How to watch route object on VueJS 2?. This is my code watch: { '$route.params.search': function(search) { console.log(search) } } It doesn't work. I try use with deep still not working on here Look on code sandbox you can watch route…
Komang Suryadana
  • 677
  • 1
  • 7
  • 17
43
votes
4 answers

Where is the expression window in Xcode 4?

How can I add an expression to watch in Xcode 4? This should be very obvious, but it is not. It does not seem to be down any menu or available on a contextual click. It would be nice if I could highlight a variable or expression and then "Add to…
jcpennypincher
  • 3,970
  • 5
  • 31
  • 44
42
votes
17 answers

fs.watch fired twice when I change the watched file

fs.watch( 'example.xml', function ( curr, prev ) { // on file change we can read the new xml fs.readFile( 'example.xml','utf8', function ( err, data ) { if ( err ) throw err; console.dir(data); console.log('Done'); }); …
39
votes
3 answers

AngularJS watch array of objects for data change

I'm implementing a shopping cart and want to store the data in localStorage. I want to watch the variable $scope.cart for change so that I can update the localStorage The cart variable looks like this: [{'name':'foo', 'id':'bar', 'amount': 1…
harinsa
  • 3,176
  • 5
  • 33
  • 53
38
votes
3 answers

Watch for object properties changes in JavaScript

Possible Duplicate: Javascript Object.Watch for all browsers? I just read Mozilla's documentation for the watch() method. It looks very useful. However, I can't find something similar for Safari. Neither Internet Explorer. How do you manage…
Philippe
  • 1,206
  • 3
  • 13
  • 19
36
votes
12 answers

Is there a smarter alternative to "watch make"?

I ran into this useful tip that if you're working on files a lot and you want them to build automatically you run: watch make And it re-runs make every couple seconds and things get built. However ... it seems to swallow all the output all the time.…
Dobes Vandermeer
  • 8,463
  • 5
  • 43
  • 46
36
votes
5 answers

Nodemon Doesn't Restart in Windows Docker Environment

My goal is to set up a Docker container that automatically restarts a NodeJS server when file changes are detected from the host machine. I have chosen nodemon to watch the files for changes. On Linux and Mac environments, nodemon and docker are…
RyanNHG
  • 1,009
  • 2
  • 8
  • 20
35
votes
1 answer

Angular JS $watch vs $on

I want to execute a function inside a directive, whenever there is a state change in the parent scope. The obvious way to achieve this is to use event broadcasts ($broadcast) and listeners ($on). I am curious if using a $watch is an alternative to…
Yogesh Mangaj
  • 3,200
  • 6
  • 32
  • 45
35
votes
1 answer

AngularJS trigger and watch object value change in service from controller

I'm trying to watch for changes in a service from a controller. I tried various things based on many qns here on stackoverflow, but I've been unable to make it work. html:
sathishvj
  • 1,394
  • 2
  • 17
  • 28
34
votes
13 answers

Java: Watching a directory to move large files

I have been writing a program that watches a directory and when files are created in it, it changes the name and moves them to a new directory. In my first implementation I used Java's Watch Service API which worked fine when I was testing 1kb…
nite
  • 763
  • 2
  • 9
  • 16
31
votes
3 answers

How to see actual value of a C++ string in CLion's debugger?

I'm using CLion on Linux and having difficulties with debugging. I evaluated an expression which ends up being a string, but the debugger is useless at showing me what the return value is, other than that it is a string. How do I see the actual…
Earlz
  • 62,085
  • 98
  • 303
  • 499
30
votes
2 answers

How to vue watch a specific property in an array of objects

I'm using vue.js 2.5.2 I have an array of objects and I'd like to watch forms[*].selected and if it changes call a function. This is my attempt, but obviously, it is not correct. I tried putting the array into a for loop to watch each object's…
Shane G
  • 3,129
  • 10
  • 43
  • 85
29
votes
4 answers

Vue 3 Composition API - watchEffect vs. watch

So I have been learning the Vue Composition API and was wondering what the difference between watchEffect and watch is. Watch says it's the same as the Vue 2 watch, so I'm guessing watchEffect is like the 2.0 of that? I'm wondering if there is any…
Ruttyj
  • 853
  • 2
  • 11
  • 18
29
votes
3 answers

Nodemon-like task in Grunt : execute node process and watch

I feel like I'm missing something. Here is what I want to achieve : Having a grunt task that executes my server.js and runs watch task in parallel. It feels to me that this is precisely one of the tasks grunt was designed for but I can't achieve…
Augustin Riedinger
  • 20,909
  • 29
  • 133
  • 206
28
votes
3 answers

VueJS - Skip watcher's first change

I'm creating a component in VueJS for an app I'm making, it has some watchers to apply logic to other parts of the component when my var changes. Once the component is initialized, it still needs to be set by some data from the server coming after a…
Pablo Villalba
  • 523
  • 1
  • 6
  • 14