{"action":"opened","number":270,"pull_request":{"url":"https://api.github.com/repos/OutWatch/outwatch/pulls/270","id":236381918,"node_id":"MDExOlB1bGxSZXF1ZXN0MjM2MzgxOTE4","html_url":"https://github.com/OutWatch/outwatch/pull/270","diff_url":"https://github.com/OutWatch/outwatch/pull/270.diff","patch_url":"https://github.com/OutWatch/outwatch/pull/270.patch","issue_url":"https://api.github.com/repos/OutWatch/outwatch/issues/270","number":270,"state":"open","locked":false,"title":"Multiple changes to Store","user":{"login":"Busti","id":3575167,"node_id":"MDQ6VXNlcjM1NzUxNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/3575167?v=4","gravatar_id":"","url":"https://api.github.com/users/Busti","html_url":"https://github.com/Busti","followers_url":"https://api.github.com/users/Busti/followers","following_url":"https://api.github.com/users/Busti/following{/other_user}","gists_url":"https://api.github.com/users/Busti/gists{/gist_id}","starred_url":"https://api.github.com/users/Busti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Busti/subscriptions","organizations_url":"https://api.github.com/users/Busti/orgs","repos_url":"https://api.github.com/users/Busti/repos","events_url":"https://api.github.com/users/Busti/events{/privacy}","received_events_url":"https://api.github.com/users/Busti/received_events","type":"User","site_admin":false},"body":"This PR makes the following changes to `Store` (in order of significance)\r\n\r\n* Makes Store emit an (action -> state) tuple.\r\n  * This tuple allows more granular control about *when* a view updates when the stores state changes.  \r\n    Methods like `collect` can now be used to, not only capture certain state changes, but they can also react to the `Action` which caused that state.  \r\n    This allows us to ignore all other Actions which are irrelevant to that specific view.  \r\n    For example, if we were to move a draggable element using a mouse cursor, we could react just to events changing the position of the element, while discarding all other state updates.\r\n    ```scala\r\n    svg(\r\n      rect(width := 10, height := 10,\r\n        x <-- store.collect { case (MoveAction, state) => state.xPos },\r\n        y <-- store.collect { case (MoveAction, state) => state.yPos }\r\n      )\r\n    )\r\n    ```\r\n  * This tuple can also be used to have other parts of the application react to an `Action`. This can be useful if we, for example want to collect numerous actions (and their resulting states) into a list, so that we can later undo them, as as is common in many applications, by, for example, hitting `ctrl + z`.\r\n  * However this addition has some implications which have further consequences.\r\n* Introduces a common Action base-trait;\r\n  * Since we now emit an `(action -> state)` tuple in `Store`, we have 2 edge cases which need to be solved.\r\n    * This PR Introduces a common starting Action: Noop;\r\n      * When created, `Store` emits it's initial State once, to every subscriber. Since that state was not determined by an Action, a placeholder action is needed.\r\n        It, `Noop` is inherited from the common `Action`.\r\n    * This PR Introduces a common Error Action which carries error data.  \r\n      * The `Error()` Action is used, when the reduction of an Action fails. It contains the errors data object.\r\n* Changes the Store type parameter naming scheme, to use Model instead of State.\r\n  * I propose the type parameters of store to be named `[A, M]`, meaning `[Action, Model]` (ordered by `In, Out]`, consistently, as the ordering is also used in `ProHandler`)\r\n    I feel like this describes the usage of these a little better, since we do not actually have a state at compile time.  \r\n    A runtime value should be named `val state: Model`\r\n* Removes startWith by using the scan0 operator;\r\n\r\n---\r\n\r\nI am afraid, that I cannot really split this into multiple commits, without a lot of work being involved, since my original branch is unable to merge due to it being forked from the `new-io`  PR while it was still in progress.","created_at":"2018-12-06T01:47:08Z","updated_at":"2018-12-06T01:47:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/OutWatch/outwatch/pulls/270/commits","review_comments_url":"https://api.github.com/repos/OutWatch/outwatch/pulls/270/comments","review_comment_url":"https://api.github.com/repos/OutWatch/outwatch/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OutWatch/outwatch/issues/270/comments","statuses_url":"https://api.github.com/repos/OutWatch/outwatch/statuses/164d33afdb97438b9c91995aa189f2b42aa5b0b2","head":{"label":"Busti:store2","ref":"store2","sha":"164d33afdb97438b9c91995aa189f2b42aa5b0b2","user":{"login":"Busti","id":3575167,"node_id":"MDQ6VXNlcjM1NzUxNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/3575167?v=4","gravatar_id":"","url":"https://api.github.com/users/Busti","html_url":"https://github.com/Busti","followers_url":"https://api.github.com/users/Busti/followers","following_url":"https://api.github.com/users/Busti/following{/other_user}","gists_url":"https://api.github.com/users/Busti/gists{/gist_id}","starred_url":"https://api.github.com/users/Busti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Busti/subscriptions","organizations_url":"https://api.github.com/users/Busti/orgs","repos_url":"https://api.github.com/users/Busti/repos","events_url":"https://api.github.com/users/Busti/events{/privacy}","received_events_url":"https://api.github.com/users/Busti/received_events","type":"User","site_admin":false},"repo":{"id":157289062,"node_id":"MDEwOlJlcG9zaXRvcnkxNTcyODkwNjI=","name":"outwatch","full_name":"Busti/outwatch","private":false,"owner":{"login":"Busti","id":3575167,"node_id":"MDQ6VXNlcjM1NzUxNjc=","avatar_url":"https://avatars2.githubusercontent.com/u/3575167?v=4","gravatar_id":"","url":"https://api.github.com/users/Busti","html_url":"https://github.com/Busti","followers_url":"https://api.github.com/users/Busti/followers","following_url":"https://api.github.com/users/Busti/following{/other_user}","gists_url":"https://api.github.com/users/Busti/gists{/gist_id}","starred_url":"https://api.github.com/users/Busti/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Busti/subscriptions","organizations_url":"https://api.github.com/users/Busti/orgs","repos_url":"https://api.github.com/users/Busti/repos","events_url":"https://api.github.com/users/Busti/events{/privacy}","received_events_url":"https://api.github.com/users/Busti/received_events","type":"User","site_admin":false},"html_url":"https://github.com/Busti/outwatch","description":"A functional and reactive UI framework based on Rx and VirtualDom","fork":true,"url":"https://api.github.com/repos/Busti/outwatch","forks_url":"https://api.github.com/repos/Busti/outwatch/forks","keys_url":"https://api.github.com/repos/Busti/outwatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Busti/outwatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Busti/outwatch/teams","hooks_url":"https://api.github.com/repos/Busti/outwatch/hooks","issue_events_url":"https://api.github.com/repos/Busti/outwatch/issues/events{/number}","events_url":"https://api.github.com/repos/Busti/outwatch/events","assignees_url":"https://api.github.com/repos/Busti/outwatch/assignees{/user}","branches_url":"https://api.github.com/repos/Busti/outwatch/branches{/branch}","tags_url":"https://api.github.com/repos/Busti/outwatch/tags","blobs_url":"https://api.github.com/repos/Busti/outwatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Busti/outwatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Busti/outwatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/Busti/outwatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Busti/outwatch/statuses/{sha}","languages_url":"https://api.github.com/repos/Busti/outwatch/languages","stargazers_url":"https://api.github.com/repos/Busti/outwatch/stargazers","contributors_url":"https://api.github.com/repos/Busti/outwatch/contributors","subscribers_url":"https://api.github.com/repos/Busti/outwatch/subscribers","subscription_url":"https://api.github.com/repos/Busti/outwatch/subscription","commits_url":"https://api.github.com/repos/Busti/outwatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/Busti/outwatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/Busti/outwatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/Busti/outwatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/Busti/outwatch/contents/{+path}","compare_url":"https://api.github.com/repos/Busti/outwatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Busti/outwatch/merges","archive_url":"https://api.github.com/repos/Busti/outwatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Busti/outwatch/downloads","issues_url":"https://api.github.com/repos/Busti/outwatch/issues{/number}","pulls_url":"https://api.github.com/repos/Busti/outwatch/pulls{/number}","milestones_url":"https://api.github.com/repos/Busti/outwatch/milestones{/number}","notifications_url":"https://api.github.com/repos/Busti/outwatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Busti/outwatch/labels{/name}","releases_url":"https://api.github.com/repos/Busti/outwatch/releases{/id}","deployments_url":"https://api.github.com/repos/Busti/outwatch/deployments","created_at":"2018-11-12T23:00:04Z","updated_at":"2018-11-12T23:00:06Z","pushed_at":"2018-12-06T00:35:42Z","git_url":"git://github.com/Busti/outwatch.git","ssh_url":"git@github.com:Busti/outwatch.git","clone_url":"https://github.com/Busti/outwatch.git","svn_url":"https://github.com/Busti/outwatch","homepage":"http://outwatch.github.io","size":1029,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"component"}},"base":{"label":"OutWatch:master","ref":"master","sha":"bc3fe373e880838cac935363d98ab448e838a64e","user":{"login":"OutWatch","id":20708480,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNzA4NDgw","avatar_url":"https://avatars1.githubusercontent.com/u/20708480?v=4","gravatar_id":"","url":"https://api.github.com/users/OutWatch","html_url":"https://github.com/OutWatch","followers_url":"https://api.github.com/users/OutWatch/followers","following_url":"https://api.github.com/users/OutWatch/following{/other_user}","gists_url":"https://api.github.com/users/OutWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/OutWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OutWatch/subscriptions","organizations_url":"https://api.github.com/users/OutWatch/orgs","repos_url":"https://api.github.com/users/OutWatch/repos","events_url":"https://api.github.com/users/OutWatch/events{/privacy}","received_events_url":"https://api.github.com/users/OutWatch/received_events","type":"Organization","site_admin":false},"repo":{"id":72870054,"node_id":"MDEwOlJlcG9zaXRvcnk3Mjg3MDA1NA==","name":"outwatch","full_name":"OutWatch/outwatch","private":false,"owner":{"login":"OutWatch","id":20708480,"node_id":"MDEyOk9yZ2FuaXphdGlvbjIwNzA4NDgw","avatar_url":"https://avatars1.githubusercontent.com/u/20708480?v=4","gravatar_id":"","url":"https://api.github.com/users/OutWatch","html_url":"https://github.com/OutWatch","followers_url":"https://api.github.com/users/OutWatch/followers","following_url":"https://api.github.com/users/OutWatch/following{/other_user}","gists_url":"https://api.github.com/users/OutWatch/gists{/gist_id}","starred_url":"https://api.github.com/users/OutWatch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OutWatch/subscriptions","organizations_url":"https://api.github.com/users/OutWatch/orgs","repos_url":"https://api.github.com/users/OutWatch/repos","events_url":"https://api.github.com/users/OutWatch/events{/privacy}","received_events_url":"https://api.github.com/users/OutWatch/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/OutWatch/outwatch","description":"A purely functional and reactive UI framework based on Monix and VirtualDom","fork":false,"url":"https://api.github.com/repos/OutWatch/outwatch","forks_url":"https://api.github.com/repos/OutWatch/outwatch/forks","keys_url":"https://api.github.com/repos/OutWatch/outwatch/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OutWatch/outwatch/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OutWatch/outwatch/teams","hooks_url":"https://api.github.com/repos/OutWatch/outwatch/hooks","issue_events_url":"https://api.github.com/repos/OutWatch/outwatch/issues/events{/number}","events_url":"https://api.github.com/repos/OutWatch/outwatch/events","assignees_url":"https://api.github.com/repos/OutWatch/outwatch/assignees{/user}","branches_url":"https://api.github.com/repos/OutWatch/outwatch/branches{/branch}","tags_url":"https://api.github.com/repos/OutWatch/outwatch/tags","blobs_url":"https://api.github.com/repos/OutWatch/outwatch/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OutWatch/outwatch/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OutWatch/outwatch/git/refs{/sha}","trees_url":"https://api.github.com/repos/OutWatch/outwatch/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OutWatch/outwatch/statuses/{sha}","languages_url":"https://api.github.com/repos/OutWatch/outwatch/languages","stargazers_url":"https://api.github.com/repos/OutWatch/outwatch/stargazers","contributors_url":"https://api.github.com/repos/OutWatch/outwatch/contributors","subscribers_url":"https://api.github.com/repos/OutWatch/outwatch/subscribers","subscription_url":"https://api.github.com/repos/OutWatch/outwatch/subscription","commits_url":"https://api.github.com/repos/OutWatch/outwatch/commits{/sha}","git_commits_url":"https://api.github.com/repos/OutWatch/outwatch/git/commits{/sha}","comments_url":"https://api.github.com/repos/OutWatch/outwatch/comments{/number}","issue_comment_url":"https://api.github.com/repos/OutWatch/outwatch/issues/comments{/number}","contents_url":"https://api.github.com/repos/OutWatch/outwatch/contents/{+path}","compare_url":"https://api.github.com/repos/OutWatch/outwatch/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OutWatch/outwatch/merges","archive_url":"https://api.github.com/repos/OutWatch/outwatch/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OutWatch/outwatch/downloads","issues_url":"https://api.github.com/repos/OutWatch/outwatch/issues{/number}","pulls_url":"https://api.github.com/repos/OutWatch/outwatch/pulls{/number}","milestones_url":"https://api.github.com/repos/OutWatch/outwatch/milestones{/number}","notifications_url":"https://api.github.com/repos/OutWatch/outwatch/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OutWatch/outwatch/labels{/name}","releases_url":"https://api.github.com/repos/OutWatch/outwatch/releases{/id}","deployments_url":"https://api.github.com/repos/OutWatch/outwatch/deployments","created_at":"2016-11-04T17:26:16Z","updated_at":"2018-12-02T11:16:52Z","pushed_at":"2018-12-01T12:54:58Z","git_url":"git://github.com/OutWatch/outwatch.git","ssh_url":"git@github.com:OutWatch/outwatch.git","clone_url":"https://github.com/OutWatch/outwatch.git","svn_url":"https://github.com/OutWatch/outwatch","homepage":"http://outwatch.github.io","size":889,"stargazers_count":241,"watchers_count":241,"language":"Scala","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":24,"mirror_url":null,"archived":false,"open_issues_count":43,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":24,"open_issues":43,"watchers":241,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OutWatch/outwatch/pulls/270"},"html":{"href":"https://github.com/OutWatch/outwatch/pull/270"},"issue":{"href":"https://api.github.com/repos/OutWatch/outwatch/issues/270"},"comments":{"href":"https://api.github.com/repos/OutWatch/outwatch/issues/270/comments"},"review_comments":{"href":"https://api.github.com/repos/OutWatch/outwatch/pulls/270/comments"},"review_comment":{"href":"https://api.github.com/repos/OutWatch/outwatch/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OutWatch/outwatch/pulls/270/commits"},"statuses":{"href":"https://api.github.com/repos/OutWatch/outwatch/statuses/164d33afdb97438b9c91995aa189f2b42aa5b0b2"}},"author_association":"NONE","merged":false,"mergeable":null,"rebaseable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"maintainer_can_modify":true,"commits":1,"additions":56,"deletions":48,"changed_files":3}}
{"actor":{"display_login":"Busti"}}