{"action":"created","issue":{"url":"https://api.github.com/repos/melanke/Watch.JS/issues/94","repository_url":"https://api.github.com/repos/melanke/Watch.JS","labels_url":"https://api.github.com/repos/melanke/Watch.JS/issues/94/labels{/name}","comments_url":"https://api.github.com/repos/melanke/Watch.JS/issues/94/comments","events_url":"https://api.github.com/repos/melanke/Watch.JS/issues/94/events","html_url":"https://github.com/melanke/Watch.JS/issues/94","id":133713157,"number":94,"title":"changing a value on a watched object and calling callWatchers does not update newValue","user":{"login":"grofit","id":927201,"avatar_url":"https://avatars.githubusercontent.com/u/927201?v=3","gravatar_id":"","url":"https://api.github.com/users/grofit","html_url":"https://github.com/grofit","followers_url":"https://api.github.com/users/grofit/followers","following_url":"https://api.github.com/users/grofit/following{/other_user}","gists_url":"https://api.github.com/users/grofit/gists{/gist_id}","starred_url":"https://api.github.com/users/grofit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grofit/subscriptions","organizations_url":"https://api.github.com/users/grofit/orgs","repos_url":"https://api.github.com/users/grofit/repos","events_url":"https://api.github.com/users/grofit/events{/privacy}","received_events_url":"https://api.github.com/users/grofit/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-15T13:28:39Z","updated_at":"2016-05-19T10:31:27Z","closed_at":null,"body":"If I were to do the following: (here is a jsfiddle https://jsfiddle.net/ocwj075r/1/)\r\n\r\n```js\r\nvar something = { foo: \"hello\"  };\r\nwatch(something, function(prop, action, newValue, oldValue){\r\n   console.log(arguments);\r\n});\r\n\r\nsomething.foo = 10;\r\ncallWatchers(something);\r\n```\r\n\r\noutputs:\r\n\r\n```\r\n'model changed', Object{0: 'foo', 1: undefined, 2: undefined, 3: undefined} // from manual update\r\n'model changed', Object{0: 'foo', 1: 'set', 2: 10, 3: 'hello'} // from normal loop notify\r\n```\r\n\r\nI was expecting:\r\n\r\nA) It would only raise a single update\r\nB) The new value would contain the value of the object\r\n\r\nSo is this a bug or is this expected behaviour as I was expecting `callWatchers` to manually check for updates outside of the loop? assuming you needed to expedite a change rather than waiting the 50ms."},"comment":{"url":"https://api.github.com/repos/melanke/Watch.JS/issues/comments/220287129","html_url":"https://github.com/melanke/Watch.JS/issues/94#issuecomment-220287129","issue_url":"https://api.github.com/repos/melanke/Watch.JS/issues/94","id":220287129,"user":{"login":"Tracreed","id":6306365,"avatar_url":"https://avatars.githubusercontent.com/u/6306365?v=3","gravatar_id":"","url":"https://api.github.com/users/Tracreed","html_url":"https://github.com/Tracreed","followers_url":"https://api.github.com/users/Tracreed/followers","following_url":"https://api.github.com/users/Tracreed/following{/other_user}","gists_url":"https://api.github.com/users/Tracreed/gists{/gist_id}","starred_url":"https://api.github.com/users/Tracreed/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Tracreed/subscriptions","organizations_url":"https://api.github.com/users/Tracreed/orgs","repos_url":"https://api.github.com/users/Tracreed/repos","events_url":"https://api.github.com/users/Tracreed/events{/privacy}","received_events_url":"https://api.github.com/users/Tracreed/received_events","type":"User","site_admin":false},"created_at":"2016-05-19T10:31:27Z","updated_at":"2016-05-19T10:31:27Z","body":"I also thought it didn't work but you need to pass a second argument that is a string of one of the properties not sure if it matters that it is a property but it does need the second argument to actually call the watcher."}}