{"action":"created","issue":{"url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/25","labels_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/25/labels{/name}","comments_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/25/comments","events_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/25/events","html_url":"https://github.com/brianmhunt/knockout-fast-foreach/issues/25","id":95475407,"number":25,"title":"Rendering error when binding the same data to multiple parts of the document","user":{"login":"cervengoc","id":6099330,"avatar_url":"https://avatars.githubusercontent.com/u/6099330?v=3","gravatar_id":"","url":"https://api.github.com/users/cervengoc","html_url":"https://github.com/cervengoc","followers_url":"https://api.github.com/users/cervengoc/followers","following_url":"https://api.github.com/users/cervengoc/following{/other_user}","gists_url":"https://api.github.com/users/cervengoc/gists{/gist_id}","starred_url":"https://api.github.com/users/cervengoc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cervengoc/subscriptions","organizations_url":"https://api.github.com/users/cervengoc/orgs","repos_url":"https://api.github.com/users/cervengoc/repos","events_url":"https://api.github.com/users/cervengoc/events{/privacy}","received_events_url":"https://api.github.com/users/cervengoc/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-16T16:39:44Z","updated_at":"2015-08-22T22:29:12Z","closed_at":null,"body":"See this fiddle: http://jsfiddle.net/48hrb9cj/5/\r\n\r\nI implemented a method called `refill` for observable arrays. This method clears the array and pushes all the given elements into it while keeping the array silent (valueWillMutate/valueHasMutated). \r\n\r\nConsider the following circumstances:\r\n1. I have more than one place where I bind the same observable array (3 in the example)\r\n2. On a button click, I pop a value, then refill the array with values.\r\n3. The values with which I refill the array contains at least one from the original value set (number 1 in the example).\r\n\r\nIn this scenario something goes crazy, I can see that always the last number which I pushed to the array (number 2 in example) gets repeated, and number or repetitions = number of usages of fastforEach binding on the same data (3 times in the example).\r\n\r\nHope you can find it out, I was looking at the code for half an hour without any idea.\r\n\r\n(I copied the latest source code for simplicity.)"},"comment":{"url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/comments/133759671","html_url":"https://github.com/brianmhunt/knockout-fast-foreach/issues/25#issuecomment-133759671","issue_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/25","id":133759671,"user":{"login":"brianmhunt","id":135528,"avatar_url":"https://avatars.githubusercontent.com/u/135528?v=3","gravatar_id":"","url":"https://api.github.com/users/brianmhunt","html_url":"https://github.com/brianmhunt","followers_url":"https://api.github.com/users/brianmhunt/followers","following_url":"https://api.github.com/users/brianmhunt/following{/other_user}","gists_url":"https://api.github.com/users/brianmhunt/gists{/gist_id}","starred_url":"https://api.github.com/users/brianmhunt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brianmhunt/subscriptions","organizations_url":"https://api.github.com/users/brianmhunt/orgs","repos_url":"https://api.github.com/users/brianmhunt/repos","events_url":"https://api.github.com/users/brianmhunt/events{/privacy}","received_events_url":"https://api.github.com/users/brianmhunt/received_events","type":"User","site_admin":false},"created_at":"2015-08-22T22:29:12Z","updated_at":"2015-08-22T22:29:12Z","body":"@cervengoc – Are you up for putting a PR in for this?"}}