{"action":"closed","issue":{"url":"https://api.github.com/repos/ractivejs/ractive/issues/2629","repository_url":"https://api.github.com/repos/ractivejs/ractive","labels_url":"https://api.github.com/repos/ractivejs/ractive/issues/2629/labels{/name}","comments_url":"https://api.github.com/repos/ractivejs/ractive/issues/2629/comments","events_url":"https://api.github.com/repos/ractivejs/ractive/issues/2629/events","html_url":"https://github.com/ractivejs/ractive/issues/2629","id":170513433,"number":2629,"title":"Recomputing a computed values causes observers to re-fire, even if the value hasn't changed","user":{"login":"Rich-Harris","id":1162160,"avatar_url":"https://avatars.githubusercontent.com/u/1162160?v=3","gravatar_id":"","url":"https://api.github.com/users/Rich-Harris","html_url":"https://github.com/Rich-Harris","followers_url":"https://api.github.com/users/Rich-Harris/followers","following_url":"https://api.github.com/users/Rich-Harris/following{/other_user}","gists_url":"https://api.github.com/users/Rich-Harris/gists{/gist_id}","starred_url":"https://api.github.com/users/Rich-Harris/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Rich-Harris/subscriptions","organizations_url":"https://api.github.com/users/Rich-Harris/orgs","repos_url":"https://api.github.com/users/Rich-Harris/repos","events_url":"https://api.github.com/users/Rich-Harris/events{/privacy}","received_events_url":"https://api.github.com/users/Rich-Harris/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ractivejs/ractive/labels/bug","name":"bug","color":"ff0000"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-08-10T20:40:18Z","updated_at":"2016-08-17T17:33:31Z","closed_at":"2016-08-17T17:33:31Z","body":"**Description of the bug:**\r\n\r\nRecomputing a computed values causes observers to re-fire, even if the value hasn't changed\r\n\r\n**Versions affected:**\r\n\r\nEdge\r\n\r\n**Reproduction:**\r\n\r\nhttp://jsfiddle.net/ub7540xq/\r\n\r\n**Code:**\r\n\r\n```js\r\nvar ractive = new Ractive({\r\n  computed: {\r\n  \tint () {\r\n    \treturn Math.round( this.get( 'number' ) );\r\n    }\r\n  },\r\n  data: {\r\n    number: 1,\r\n    observerCalledTimes: 0\r\n  }\r\n});\r\n\r\nractive.observe( 'int', function ( int ) {\r\n  console.log( int );\r\n  this.add( 'observerCalledTimes', 1 );\r\n});\r\n\r\nractive.set( 'number', 1.1 );\r\nractive.set( 'number', 1.2 );\r\nractive.set( 'number', 1.3 );\r\nractive.set( 'number', 1.4 );\r\n\r\nconsole.log( ractive.get( 'observerCalledTimes' ) );\r\n// expected 1, got 5\r\n```\r\n"}}
{"actor":{"display_login":"evs-chris"}}