{"action":"opened","number":697,"pull_request":{"url":"https://api.github.com/repos/mobxjs/mobx/pulls/697","id":96691323,"html_url":"https://github.com/mobxjs/mobx/pull/697","diff_url":"https://github.com/mobxjs/mobx/pull/697.diff","patch_url":"https://github.com/mobxjs/mobx/pull/697.patch","issue_url":"https://api.github.com/repos/mobxjs/mobx/issues/697","number":697,"state":"open","locked":false,"title":"add ObservableArray.move method","user":{"login":"dslmeinte","id":683931,"avatar_url":"https://avatars.githubusercontent.com/u/683931?v=3","gravatar_id":"","url":"https://api.github.com/users/dslmeinte","html_url":"https://github.com/dslmeinte","followers_url":"https://api.github.com/users/dslmeinte/followers","following_url":"https://api.github.com/users/dslmeinte/following{/other_user}","gists_url":"https://api.github.com/users/dslmeinte/gists{/gist_id}","starred_url":"https://api.github.com/users/dslmeinte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dslmeinte/subscriptions","organizations_url":"https://api.github.com/users/dslmeinte/orgs","repos_url":"https://api.github.com/users/dslmeinte/repos","events_url":"https://api.github.com/users/dslmeinte/events{/privacy}","received_events_url":"https://api.github.com/users/dslmeinte/received_events","type":"User","site_admin":false},"body":"Adds a .move method for moving individual elements around in an observable array. This is convenient to do that in an atomic way since otherwise a move can only be expressed by at least two splices. The resulting change is still one splice, but one that replace all array members: it's up to client to recognize this fact.\r\n\r\nFor documentation, add the following to https://mobxjs.github.io/mobx/refguide/array.html :\r\n\r\n`move(fromIndex, toIndex)` Moves the element at index `fromIndex` to index `toIndex` in the array, with other array members shifting at most 1 position, and either all right or all left depending on the value of `toIndex - fromIndex`.\r\nExamples: `observable([0, 1, 2, 3]).move(1, 2).slice()` yields `[0, 2, 1, 3]`, and `observable([0, 1, 2, 3]).move(3, 1).slice()` yields `[0, 3, 1, 2]`. (See unit tests for more examples.)\r\nThe method throws if indices are out of bounds, and does nothing when `fromIndex` equals `toIndex`.\r\n\r\n\r\n\r\nThanks for taking the effort to create a PR!\r\n\r\nIf you are creating an extensive issue, you might want to open an issue with your idea first, so that you don't put a lot of effort in an PR that wouldn't be accepted ;-).\r\n\r\nPR checklist:\r\n\r\n* [x] Implementation\r\n* [x] Added tests\r\n* [x] Verified that there is no significant performance drop (`npm run perf`)\r\n* [ ] Updated (either in the description of this PR as markdown, or as seperate PR on the `gh-pages` branch. Please refer to this PR). For new functionality, at least [API.md](https://github.com/mobxjs/mobx/blob/gh-pages/docs/refguide/api.md) should be updated\r\n* [x] Added type annotations (if you are unfamiliar with typescript, untyped, `:any` based PR's are welcome as well\r\n","created_at":"2016-12-06T09:49:54Z","updated_at":"2016-12-06T09:49:54Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/mobxjs/mobx/pulls/697/commits","review_comments_url":"https://api.github.com/repos/mobxjs/mobx/pulls/697/comments","review_comment_url":"https://api.github.com/repos/mobxjs/mobx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mobxjs/mobx/issues/697/comments","statuses_url":"https://api.github.com/repos/mobxjs/mobx/statuses/16368145324de733b22624d29e68a649fadf2416","head":{"label":"dslmeinte:move-within-IObservableArray","ref":"move-within-IObservableArray","sha":"16368145324de733b22624d29e68a649fadf2416","user":{"login":"dslmeinte","id":683931,"avatar_url":"https://avatars.githubusercontent.com/u/683931?v=3","gravatar_id":"","url":"https://api.github.com/users/dslmeinte","html_url":"https://github.com/dslmeinte","followers_url":"https://api.github.com/users/dslmeinte/followers","following_url":"https://api.github.com/users/dslmeinte/following{/other_user}","gists_url":"https://api.github.com/users/dslmeinte/gists{/gist_id}","starred_url":"https://api.github.com/users/dslmeinte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dslmeinte/subscriptions","organizations_url":"https://api.github.com/users/dslmeinte/orgs","repos_url":"https://api.github.com/users/dslmeinte/repos","events_url":"https://api.github.com/users/dslmeinte/events{/privacy}","received_events_url":"https://api.github.com/users/dslmeinte/received_events","type":"User","site_admin":false},"repo":{"id":70698705,"name":"mobx","full_name":"dslmeinte/mobx","owner":{"login":"dslmeinte","id":683931,"avatar_url":"https://avatars.githubusercontent.com/u/683931?v=3","gravatar_id":"","url":"https://api.github.com/users/dslmeinte","html_url":"https://github.com/dslmeinte","followers_url":"https://api.github.com/users/dslmeinte/followers","following_url":"https://api.github.com/users/dslmeinte/following{/other_user}","gists_url":"https://api.github.com/users/dslmeinte/gists{/gist_id}","starred_url":"https://api.github.com/users/dslmeinte/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dslmeinte/subscriptions","organizations_url":"https://api.github.com/users/dslmeinte/orgs","repos_url":"https://api.github.com/users/dslmeinte/repos","events_url":"https://api.github.com/users/dslmeinte/events{/privacy}","received_events_url":"https://api.github.com/users/dslmeinte/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dslmeinte/mobx","description":"Simple, scalable state management.","fork":true,"url":"https://api.github.com/repos/dslmeinte/mobx","forks_url":"https://api.github.com/repos/dslmeinte/mobx/forks","keys_url":"https://api.github.com/repos/dslmeinte/mobx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dslmeinte/mobx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dslmeinte/mobx/teams","hooks_url":"https://api.github.com/repos/dslmeinte/mobx/hooks","issue_events_url":"https://api.github.com/repos/dslmeinte/mobx/issues/events{/number}","events_url":"https://api.github.com/repos/dslmeinte/mobx/events","assignees_url":"https://api.github.com/repos/dslmeinte/mobx/assignees{/user}","branches_url":"https://api.github.com/repos/dslmeinte/mobx/branches{/branch}","tags_url":"https://api.github.com/repos/dslmeinte/mobx/tags","blobs_url":"https://api.github.com/repos/dslmeinte/mobx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dslmeinte/mobx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dslmeinte/mobx/git/refs{/sha}","trees_url":"https://api.github.com/repos/dslmeinte/mobx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dslmeinte/mobx/statuses/{sha}","languages_url":"https://api.github.com/repos/dslmeinte/mobx/languages","stargazers_url":"https://api.github.com/repos/dslmeinte/mobx/stargazers","contributors_url":"https://api.github.com/repos/dslmeinte/mobx/contributors","subscribers_url":"https://api.github.com/repos/dslmeinte/mobx/subscribers","subscription_url":"https://api.github.com/repos/dslmeinte/mobx/subscription","commits_url":"https://api.github.com/repos/dslmeinte/mobx/commits{/sha}","git_commits_url":"https://api.github.com/repos/dslmeinte/mobx/git/commits{/sha}","comments_url":"https://api.github.com/repos/dslmeinte/mobx/comments{/number}","issue_comment_url":"https://api.github.com/repos/dslmeinte/mobx/issues/comments{/number}","contents_url":"https://api.github.com/repos/dslmeinte/mobx/contents/{+path}","compare_url":"https://api.github.com/repos/dslmeinte/mobx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dslmeinte/mobx/merges","archive_url":"https://api.github.com/repos/dslmeinte/mobx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dslmeinte/mobx/downloads","issues_url":"https://api.github.com/repos/dslmeinte/mobx/issues{/number}","pulls_url":"https://api.github.com/repos/dslmeinte/mobx/pulls{/number}","milestones_url":"https://api.github.com/repos/dslmeinte/mobx/milestones{/number}","notifications_url":"https://api.github.com/repos/dslmeinte/mobx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dslmeinte/mobx/labels{/name}","releases_url":"https://api.github.com/repos/dslmeinte/mobx/releases{/id}","deployments_url":"https://api.github.com/repos/dslmeinte/mobx/deployments","created_at":"2016-10-12T12:40:43Z","updated_at":"2016-10-12T12:40:44Z","pushed_at":"2016-12-06T09:40:05Z","git_url":"git://github.com/dslmeinte/mobx.git","ssh_url":"git@github.com:dslmeinte/mobx.git","clone_url":"https://github.com/dslmeinte/mobx.git","svn_url":"https://github.com/dslmeinte/mobx","homepage":"https://mobxjs.github.io/mobx","size":4893,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"mobxjs:master","ref":"master","sha":"daa17482b987b4c75e50fde7a192b45c1aa36c07","user":{"login":"mobxjs","id":17475736,"avatar_url":"https://avatars.githubusercontent.com/u/17475736?v=3","gravatar_id":"","url":"https://api.github.com/users/mobxjs","html_url":"https://github.com/mobxjs","followers_url":"https://api.github.com/users/mobxjs/followers","following_url":"https://api.github.com/users/mobxjs/following{/other_user}","gists_url":"https://api.github.com/users/mobxjs/gists{/gist_id}","starred_url":"https://api.github.com/users/mobxjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobxjs/subscriptions","organizations_url":"https://api.github.com/users/mobxjs/orgs","repos_url":"https://api.github.com/users/mobxjs/repos","events_url":"https://api.github.com/users/mobxjs/events{/privacy}","received_events_url":"https://api.github.com/users/mobxjs/received_events","type":"Organization","site_admin":false},"repo":{"id":32215970,"name":"mobx","full_name":"mobxjs/mobx","owner":{"login":"mobxjs","id":17475736,"avatar_url":"https://avatars.githubusercontent.com/u/17475736?v=3","gravatar_id":"","url":"https://api.github.com/users/mobxjs","html_url":"https://github.com/mobxjs","followers_url":"https://api.github.com/users/mobxjs/followers","following_url":"https://api.github.com/users/mobxjs/following{/other_user}","gists_url":"https://api.github.com/users/mobxjs/gists{/gist_id}","starred_url":"https://api.github.com/users/mobxjs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mobxjs/subscriptions","organizations_url":"https://api.github.com/users/mobxjs/orgs","repos_url":"https://api.github.com/users/mobxjs/repos","events_url":"https://api.github.com/users/mobxjs/events{/privacy}","received_events_url":"https://api.github.com/users/mobxjs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mobxjs/mobx","description":"Simple, scalable state management.","fork":false,"url":"https://api.github.com/repos/mobxjs/mobx","forks_url":"https://api.github.com/repos/mobxjs/mobx/forks","keys_url":"https://api.github.com/repos/mobxjs/mobx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mobxjs/mobx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mobxjs/mobx/teams","hooks_url":"https://api.github.com/repos/mobxjs/mobx/hooks","issue_events_url":"https://api.github.com/repos/mobxjs/mobx/issues/events{/number}","events_url":"https://api.github.com/repos/mobxjs/mobx/events","assignees_url":"https://api.github.com/repos/mobxjs/mobx/assignees{/user}","branches_url":"https://api.github.com/repos/mobxjs/mobx/branches{/branch}","tags_url":"https://api.github.com/repos/mobxjs/mobx/tags","blobs_url":"https://api.github.com/repos/mobxjs/mobx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mobxjs/mobx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mobxjs/mobx/git/refs{/sha}","trees_url":"https://api.github.com/repos/mobxjs/mobx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mobxjs/mobx/statuses/{sha}","languages_url":"https://api.github.com/repos/mobxjs/mobx/languages","stargazers_url":"https://api.github.com/repos/mobxjs/mobx/stargazers","contributors_url":"https://api.github.com/repos/mobxjs/mobx/contributors","subscribers_url":"https://api.github.com/repos/mobxjs/mobx/subscribers","subscription_url":"https://api.github.com/repos/mobxjs/mobx/subscription","commits_url":"https://api.github.com/repos/mobxjs/mobx/commits{/sha}","git_commits_url":"https://api.github.com/repos/mobxjs/mobx/git/commits{/sha}","comments_url":"https://api.github.com/repos/mobxjs/mobx/comments{/number}","issue_comment_url":"https://api.github.com/repos/mobxjs/mobx/issues/comments{/number}","contents_url":"https://api.github.com/repos/mobxjs/mobx/contents/{+path}","compare_url":"https://api.github.com/repos/mobxjs/mobx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mobxjs/mobx/merges","archive_url":"https://api.github.com/repos/mobxjs/mobx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mobxjs/mobx/downloads","issues_url":"https://api.github.com/repos/mobxjs/mobx/issues{/number}","pulls_url":"https://api.github.com/repos/mobxjs/mobx/pulls{/number}","milestones_url":"https://api.github.com/repos/mobxjs/mobx/milestones{/number}","notifications_url":"https://api.github.com/repos/mobxjs/mobx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mobxjs/mobx/labels{/name}","releases_url":"https://api.github.com/repos/mobxjs/mobx/releases{/id}","deployments_url":"https://api.github.com/repos/mobxjs/mobx/deployments","created_at":"2015-03-14T14:31:38Z","updated_at":"2016-12-06T09:21:59Z","pushed_at":"2016-12-06T09:49:54Z","git_url":"git://github.com/mobxjs/mobx.git","ssh_url":"git@github.com:mobxjs/mobx.git","clone_url":"https://github.com/mobxjs/mobx.git","svn_url":"https://github.com/mobxjs/mobx","homepage":"https://mobxjs.github.io/mobx","size":13787,"stargazers_count":5965,"watchers_count":5965,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":259,"mirror_url":null,"open_issues_count":51,"forks":259,"open_issues":51,"watchers":5965,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mobxjs/mobx/pulls/697"},"html":{"href":"https://github.com/mobxjs/mobx/pull/697"},"issue":{"href":"https://api.github.com/repos/mobxjs/mobx/issues/697"},"comments":{"href":"https://api.github.com/repos/mobxjs/mobx/issues/697/comments"},"review_comments":{"href":"https://api.github.com/repos/mobxjs/mobx/pulls/697/comments"},"review_comment":{"href":"https://api.github.com/repos/mobxjs/mobx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mobxjs/mobx/pulls/697/commits"},"statuses":{"href":"https://api.github.com/repos/mobxjs/mobx/statuses/16368145324de733b22624d29e68a649fadf2416"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":1,"additions":80,"deletions":1,"changed_files":2}}
{"actor":{"display_login":"dslmeinte"}}