{"action":"created","issue":{"url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/2","labels_url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/2/labels{/name}","comments_url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/2/comments","events_url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/2/events","html_url":"https://github.com/MaxArt2501/object-observe/issues/2","id":56961184,"number":2,"title":"Synchronous checking feature","user":{"login":"m93a","id":1671665,"avatar_url":"https://avatars.githubusercontent.com/u/1671665?v=3","gravatar_id":"","url":"https://api.github.com/users/m93a","html_url":"https://github.com/m93a","followers_url":"https://api.github.com/users/m93a/followers","following_url":"https://api.github.com/users/m93a/following{/other_user}","gists_url":"https://api.github.com/users/m93a/gists{/gist_id}","starred_url":"https://api.github.com/users/m93a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m93a/subscriptions","organizations_url":"https://api.github.com/users/m93a/orgs","repos_url":"https://api.github.com/users/m93a/repos","events_url":"https://api.github.com/users/m93a/events{/privacy}","received_events_url":"https://api.github.com/users/m93a/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/MaxArt2501/object-observe/labels/wontfix","name":"wontfix","color":"ffffff"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-02-08T18:17:20Z","updated_at":"2015-02-09T18:18:00Z","closed_at":"2015-02-08T20:31:30Z","body":"I'm working on an online app that synchronizes object data between peers across the web. It's _that_ kind of apps that run a certain piece of code over and over again. Wait – it's the same kind of app as the `Object.observe` polyfill! The deal is that I need to check the observed object only once a cycle which would be much less computationally expensive than the _dirty checking_ that is used now. Actually it would slow my code down a bit because it would require the checks to run synchronously but the advantages became more noticeable when more simultaneous scripts are used.\r\n\r\nThe feature I suggest would be used approximately this way:\r\n```javascript\r\nvar obj = {};\r\nvar trig = Object.observe(\r\n  obj,\r\n  observer,\r\n  /* additional non-standard flag: */ true\r\n);\r\n\r\nfunction myLoop(){\r\n  if(trig){ //the standard code would result in trig===undefined\r\n    //the polyfill would return a trigger function instead\r\n    trig(); //now all the changes are checked\r\n  }\r\n  requestAnimationFrame(myLoop);\r\n  //do something\r\n}\r\nfunction observer(changes){\r\n  //do something\r\n}\r\n```\r\n\r\nI'm not sure whether it's clear... It would be just an improvement for programmers that understand how the polyfill works."},"comment":{"url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/comments/73559907","html_url":"https://github.com/MaxArt2501/object-observe/issues/2#issuecomment-73559907","issue_url":"https://api.github.com/repos/MaxArt2501/object-observe/issues/2","id":73559907,"user":{"login":"m93a","id":1671665,"avatar_url":"https://avatars.githubusercontent.com/u/1671665?v=3","gravatar_id":"","url":"https://api.github.com/users/m93a","html_url":"https://github.com/m93a","followers_url":"https://api.github.com/users/m93a/followers","following_url":"https://api.github.com/users/m93a/following{/other_user}","gists_url":"https://api.github.com/users/m93a/gists{/gist_id}","starred_url":"https://api.github.com/users/m93a/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m93a/subscriptions","organizations_url":"https://api.github.com/users/m93a/orgs","repos_url":"https://api.github.com/users/m93a/repos","events_url":"https://api.github.com/users/m93a/events{/privacy}","received_events_url":"https://api.github.com/users/m93a/received_events","type":"User","site_admin":false},"created_at":"2015-02-09T18:18:00Z","updated_at":"2015-02-09T18:18:00Z","body":"Oh, they throw an error?\r\nOK, I believe you."}}