{"action":"created","issue":{"url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/33","labels_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/33/labels{/name}","comments_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/33/comments","events_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/33/events","html_url":"https://github.com/brianmhunt/knockout-fast-foreach/issues/33","id":117458794,"number":33,"title":"Implement the \"moved\" array change type","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":7,"created_at":"2015-11-17T21:48:17Z","updated_at":"2015-11-18T22:11:54Z","closed_at":null,"body":"I opened this issue to start a discussion about a possible implementation of the scenario when one or more items got moved in the unerlying array.\r\n\r\nIn the array change objects there is a corresponding \"moved\" property which cross-references a \"deleted\" and an \"added\" event. The binding could possibly make use of it and instead of deleting and recreating the item, it could move the related DOM nodes simply to its new place and maintain it's internal state accordingly.\r\n\r\nProblems what I see now:\r\n\r\n1. How is knockout sending the \"moved\" flag? I mean if there is an addition of a new item in the change list, and some \"moved\" changes are after it, will the \"moved\" index mean the new index set after the earlier addition, or the original index set.. if you know what I mean. The behaviour is not trivial when it comes to a bit more compley situation, and would need some deeper investigation, or someone's thoughts who knows knockout's array change handling algorithm more deeply (I'm surely not one of them currently).\r\n\r\n2. The implementation seems more simple when only one move is detected. But what about when it's more move? I mean there can be \"move chains\", etc. which can be tricky to track down and handle properly."},"comment":{"url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/comments/157881227","html_url":"https://github.com/brianmhunt/knockout-fast-foreach/issues/33#issuecomment-157881227","issue_url":"https://api.github.com/repos/brianmhunt/knockout-fast-foreach/issues/33","id":157881227,"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-11-18T22:11:54Z","updated_at":"2015-11-18T22:11:54Z","body":"p.s.\r\n\r\n> By the way, in my progress of thinking I've found a more simple, and completely robust way to handle batch additions. I'll create a separate pull request for that anyways.\r\n\r\n:+1: ;)"}}