{"action":"created","issue":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3269","repository_url":"https://api.github.com/repos/Automattic/wp-calypso","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3269/labels{/name}","comments_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3269/comments","events_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3269/events","html_url":"https://github.com/Automattic/wp-calypso/pull/3269","id":133133064,"number":3269,"title":"Offline Redux Replay Middleware Shenanigans","user":{"login":"artpi","id":3775068,"avatar_url":"https://avatars.githubusercontent.com/u/3775068?v=3","gravatar_id":"","url":"https://api.github.com/users/artpi","html_url":"https://github.com/artpi","followers_url":"https://api.github.com/users/artpi/followers","following_url":"https://api.github.com/users/artpi/following{/other_user}","gists_url":"https://api.github.com/users/artpi/gists{/gist_id}","starred_url":"https://api.github.com/users/artpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artpi/subscriptions","organizations_url":"https://api.github.com/users/artpi/orgs","repos_url":"https://api.github.com/users/artpi/repos","events_url":"https://api.github.com/users/artpi/events{/privacy}","received_events_url":"https://api.github.com/users/artpi/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/Framework","name":"Framework","color":"006b75"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20In%20Progress","name":"[Status] In Progress","color":"207de5"},{"url":"https://api.github.com/repos/Automattic/wp-calypso/labels/[Status]%20Needs%20Review","name":"[Status] Needs Review","color":"fbca04"}],"state":"open","locked":false,"assignee":{"login":"artpi","id":3775068,"avatar_url":"https://avatars.githubusercontent.com/u/3775068?v=3","gravatar_id":"","url":"https://api.github.com/users/artpi","html_url":"https://github.com/artpi","followers_url":"https://api.github.com/users/artpi/followers","following_url":"https://api.github.com/users/artpi/following{/other_user}","gists_url":"https://api.github.com/users/artpi/gists{/gist_id}","starred_url":"https://api.github.com/users/artpi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/artpi/subscriptions","organizations_url":"https://api.github.com/users/artpi/orgs","repos_url":"https://api.github.com/users/artpi/repos","events_url":"https://api.github.com/users/artpi/events{/privacy}","received_events_url":"https://api.github.com/users/artpi/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/56","html_url":"https://github.com/Automattic/wp-calypso/milestones/Calypso%20Core:%20Offline%204","labels_url":"https://api.github.com/repos/Automattic/wp-calypso/milestones/56/labels","id":1578428,"number":56,"title":"Calypso Core: Offline 4","description":"","creator":{"login":"rralian","id":134044,"avatar_url":"https://avatars.githubusercontent.com/u/134044?v=3","gravatar_id":"","url":"https://api.github.com/users/rralian","html_url":"https://github.com/rralian","followers_url":"https://api.github.com/users/rralian/followers","following_url":"https://api.github.com/users/rralian/following{/other_user}","gists_url":"https://api.github.com/users/rralian/gists{/gist_id}","starred_url":"https://api.github.com/users/rralian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rralian/subscriptions","organizations_url":"https://api.github.com/users/rralian/orgs","repos_url":"https://api.github.com/users/rralian/repos","events_url":"https://api.github.com/users/rralian/events{/privacy}","received_events_url":"https://api.github.com/users/rralian/received_events","type":"User","site_admin":false},"open_issues":20,"closed_issues":1,"state":"open","created_at":"2016-02-11T20:24:11Z","updated_at":"2016-02-13T01:47:58Z","due_on":"2016-02-16T06:00:00Z","closed_at":null},"comments":2,"created_at":"2016-02-12T01:09:52Z","updated_at":"2016-02-13T02:24:35Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/Automattic/wp-calypso/pulls/3269","html_url":"https://github.com/Automattic/wp-calypso/pull/3269","diff_url":"https://github.com/Automattic/wp-calypso/pull/3269.diff","patch_url":"https://github.com/Automattic/wp-calypso/pull/3269.patch"},"body":"This is pretty experimental approach to redux action replay after sync.\r\n\r\nI have also made a few changes in `site/plans` to demonstrate how it should work.\r\n(Plans/compare has a poller, so we generate a lot of actions, but it still demonstrates)\r\n\r\n# Wanna see\r\n\r\n- Check out the branch\r\n- Go to `site/plans` of your site\r\n- See placeholders\r\n- Input `testReplay()` in console to simulate resotred connection\r\n\r\n# How to use middleware\r\n\r\n- Instead of using `thunk` for your asynchronous action creator, you use a simple action creator\r\n- your put \"asynchronous\" part of your action in a seperate action\r\n- `import { registerConnection } from 'state/connectionMiddleware/middleware'; `;\r\n- You register this connection with `registerConnection( actionName, connectionFunction, options );`\r\n- If you put `offlineQueue: true` in options, your connection will be replayed after reconnecting.\r\n\r\nI know jsdocs are bad, and some stuff shoulf be in seperate files.\r\nI mostly want to know:\r\nshould we pursue this direction?\r\n\r\nCC: @aduth , @gwwar , @mtias , @rralian , @retrofox \r\n\r\n"},"comment":{"url":"https://api.github.com/repos/Automattic/wp-calypso/issues/comments/183564072","html_url":"https://github.com/Automattic/wp-calypso/pull/3269#issuecomment-183564072","issue_url":"https://api.github.com/repos/Automattic/wp-calypso/issues/3269","id":183564072,"user":{"login":"gwwar","id":1270189,"avatar_url":"https://avatars.githubusercontent.com/u/1270189?v=3","gravatar_id":"","url":"https://api.github.com/users/gwwar","html_url":"https://github.com/gwwar","followers_url":"https://api.github.com/users/gwwar/followers","following_url":"https://api.github.com/users/gwwar/following{/other_user}","gists_url":"https://api.github.com/users/gwwar/gists{/gist_id}","starred_url":"https://api.github.com/users/gwwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gwwar/subscriptions","organizations_url":"https://api.github.com/users/gwwar/orgs","repos_url":"https://api.github.com/users/gwwar/repos","events_url":"https://api.github.com/users/gwwar/events{/privacy}","received_events_url":"https://api.github.com/users/gwwar/received_events","type":"User","site_admin":false},"created_at":"2016-02-13T02:24:35Z","updated_at":"2016-02-13T02:24:35Z","body":":+1: Definitely an interesting idea to investigate further. :smile:  Don't be surprised though if we hit some sharp corners. "}}