{"action":"created","comment":{"url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/comments/245111714","pull_request_review_id":189154816,"id":245111714,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0NTExMTcxNA==","diff_hunk":"@@ -1,49 +1,43 @@\n import React from 'react';\n+import { connect } from 'react-redux';\n import PropTypes from 'prop-types';\n import NProgress from 'nprogress';\n \n class Spinner extends React.Component {\n+  componentDidUpdate(prevProps) {\n+    const diff = this.props.pendingTasks - prevProps.pendingTasks;\n+    if (diff > 0) {\n+      NProgress.start();\n+    }\n+    if (diff < 0) {\n+      NProgress.inc();\n+    }\n+    if (this.props.pendingTasks === 0) {\n+      NProgress.done();\n+    }\n+  }\n+\n   componentDidMount() {\n-    const { store } = this.context;\n     const { config } = this.props;\n-    this.previousPendingTasks = store.getState().pendingTasks;\n     NProgress.configure(config);\n-    this.disposeStoreSubscription = store.subscribe(() => {\n-      const diff = store.getState().pendingTasks - this.previousPendingTasks;\n-      if (diff > 0) {\n-        NProgress.start();\n-      }\n-      if (diff < 0) {\n-        NProgress.inc();\n-      }\n-      if (store.getState().pendingTasks === 0) {\n-        NProgress.done();\n-      }\n-      this.previousPendingTasks = store.getState().pendingTasks;\n-    });\n-  }\n-\n-  componentWillUnmount() {\n-    this.disposeStoreSubscription();\n   }\n \n   render() {\n-    return false;\n+    return null;","path":"src/spinner.js","position":46,"original_position":46,"commit_id":"f20f8dd538d0dc1c233f978b6fe1ce351e1d9249","original_commit_id":"f20f8dd538d0dc1c233f978b6fe1ce351e1d9249","user":{"login":"TimAstier","id":8555097,"node_id":"MDQ6VXNlcjg1NTUwOTc=","avatar_url":"https://avatars1.githubusercontent.com/u/8555097?v=4","gravatar_id":"","url":"https://api.github.com/users/TimAstier","html_url":"https://github.com/TimAstier","followers_url":"https://api.github.com/users/TimAstier/followers","following_url":"https://api.github.com/users/TimAstier/following{/other_user}","gists_url":"https://api.github.com/users/TimAstier/gists{/gist_id}","starred_url":"https://api.github.com/users/TimAstier/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/TimAstier/subscriptions","organizations_url":"https://api.github.com/users/TimAstier/orgs","repos_url":"https://api.github.com/users/TimAstier/repos","events_url":"https://api.github.com/users/TimAstier/events{/privacy}","received_events_url":"https://api.github.com/users/TimAstier/received_events","type":"User","site_admin":false},"body":"Nice ;)","created_at":"2019-01-03T19:44:18Z","updated_at":"2019-01-03T19:46:21Z","html_url":"https://github.com/Storytel/react-redux-spinner/pull/29#discussion_r245111714","pull_request_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/comments/245111714"},"html":{"href":"https://github.com/Storytel/react-redux-spinner/pull/29#discussion_r245111714"},"pull_request":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29"}}},"pull_request":{"url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29","id":242002722,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQyMDAyNzIy","html_url":"https://github.com/Storytel/react-redux-spinner/pull/29","diff_url":"https://github.com/Storytel/react-redux-spinner/pull/29.diff","patch_url":"https://github.com/Storytel/react-redux-spinner/pull/29.patch","issue_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/29","number":29,"state":"open","locked":false,"title":"React redux spinner v2","user":{"login":"domszyn","id":9725140,"node_id":"MDQ6VXNlcjk3MjUxNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/9725140?v=4","gravatar_id":"","url":"https://api.github.com/users/domszyn","html_url":"https://github.com/domszyn","followers_url":"https://api.github.com/users/domszyn/followers","following_url":"https://api.github.com/users/domszyn/following{/other_user}","gists_url":"https://api.github.com/users/domszyn/gists{/gist_id}","starred_url":"https://api.github.com/users/domszyn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/domszyn/subscriptions","organizations_url":"https://api.github.com/users/domszyn/orgs","repos_url":"https://api.github.com/users/domszyn/repos","events_url":"https://api.github.com/users/domszyn/events{/privacy}","received_events_url":"https://api.github.com/users/domszyn/received_events","type":"User","site_admin":false},"body":"React Redux has started using new React Context API in the latest release\r\nhttps://github.com/reduxjs/react-redux/releases/tag/v6.0.0\r\n\r\nThis is a breaking change because the legacy React context is no longer holding a reference to the Redux store.\r\n\r\nThe seemingly simplest way to fix this is to access `ReactReduxContext` directly, as described here https://react-redux.js.org/using-react-redux/accessing-store#using-reactreduxcontext-directly\r\nThere are only 2 problems with this approach: it is not considered a part of the public React Redux API, and we have to make sure React Redux is imported from the single location only to be able to read the context value.\r\n\r\nThis PR fixes the issue by converting a `<Spinner />` component into a connected one, using the `connect` API. This allows to access the store regardless of how it is stored in the context.\r\n\r\nI have also upgraded all packages to their latest versions and added support for EcmaScript and CommonJS output. ","created_at":"2019-01-03T14:01:19Z","updated_at":"2019-01-03T19:46:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"98ea7667464d51bd945a790aed0209bc12e47eda","assignee":null,"assignees":[],"requested_reviewers":[{"login":"noseglid","id":933880,"node_id":"MDQ6VXNlcjkzMzg4MA==","avatar_url":"https://avatars1.githubusercontent.com/u/933880?v=4","gravatar_id":"","url":"https://api.github.com/users/noseglid","html_url":"https://github.com/noseglid","followers_url":"https://api.github.com/users/noseglid/followers","following_url":"https://api.github.com/users/noseglid/following{/other_user}","gists_url":"https://api.github.com/users/noseglid/gists{/gist_id}","starred_url":"https://api.github.com/users/noseglid/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/noseglid/subscriptions","organizations_url":"https://api.github.com/users/noseglid/orgs","repos_url":"https://api.github.com/users/noseglid/repos","events_url":"https://api.github.com/users/noseglid/events{/privacy}","received_events_url":"https://api.github.com/users/noseglid/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29/commits","review_comments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29/comments","review_comment_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/29/comments","statuses_url":"https://api.github.com/repos/Storytel/react-redux-spinner/statuses/f20f8dd538d0dc1c233f978b6fe1ce351e1d9249","head":{"label":"Storytel:react-redux-spinner-v2","ref":"react-redux-spinner-v2","sha":"f20f8dd538d0dc1c233f978b6fe1ce351e1d9249","user":{"login":"Storytel","id":6998916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg5MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/6998916?v=4","gravatar_id":"","url":"https://api.github.com/users/Storytel","html_url":"https://github.com/Storytel","followers_url":"https://api.github.com/users/Storytel/followers","following_url":"https://api.github.com/users/Storytel/following{/other_user}","gists_url":"https://api.github.com/users/Storytel/gists{/gist_id}","starred_url":"https://api.github.com/users/Storytel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storytel/subscriptions","organizations_url":"https://api.github.com/users/Storytel/orgs","repos_url":"https://api.github.com/users/Storytel/repos","events_url":"https://api.github.com/users/Storytel/events{/privacy}","received_events_url":"https://api.github.com/users/Storytel/received_events","type":"Organization","site_admin":false},"repo":{"id":53578568,"node_id":"MDEwOlJlcG9zaXRvcnk1MzU3ODU2OA==","name":"react-redux-spinner","full_name":"Storytel/react-redux-spinner","private":false,"owner":{"login":"Storytel","id":6998916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg5MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/6998916?v=4","gravatar_id":"","url":"https://api.github.com/users/Storytel","html_url":"https://github.com/Storytel","followers_url":"https://api.github.com/users/Storytel/followers","following_url":"https://api.github.com/users/Storytel/following{/other_user}","gists_url":"https://api.github.com/users/Storytel/gists{/gist_id}","starred_url":"https://api.github.com/users/Storytel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storytel/subscriptions","organizations_url":"https://api.github.com/users/Storytel/orgs","repos_url":"https://api.github.com/users/Storytel/repos","events_url":"https://api.github.com/users/Storytel/events{/privacy}","received_events_url":"https://api.github.com/users/Storytel/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Storytel/react-redux-spinner","description":"An automatic spinner for react and redux","fork":false,"url":"https://api.github.com/repos/Storytel/react-redux-spinner","forks_url":"https://api.github.com/repos/Storytel/react-redux-spinner/forks","keys_url":"https://api.github.com/repos/Storytel/react-redux-spinner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Storytel/react-redux-spinner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Storytel/react-redux-spinner/teams","hooks_url":"https://api.github.com/repos/Storytel/react-redux-spinner/hooks","issue_events_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/events{/number}","events_url":"https://api.github.com/repos/Storytel/react-redux-spinner/events","assignees_url":"https://api.github.com/repos/Storytel/react-redux-spinner/assignees{/user}","branches_url":"https://api.github.com/repos/Storytel/react-redux-spinner/branches{/branch}","tags_url":"https://api.github.com/repos/Storytel/react-redux-spinner/tags","blobs_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Storytel/react-redux-spinner/statuses/{sha}","languages_url":"https://api.github.com/repos/Storytel/react-redux-spinner/languages","stargazers_url":"https://api.github.com/repos/Storytel/react-redux-spinner/stargazers","contributors_url":"https://api.github.com/repos/Storytel/react-redux-spinner/contributors","subscribers_url":"https://api.github.com/repos/Storytel/react-redux-spinner/subscribers","subscription_url":"https://api.github.com/repos/Storytel/react-redux-spinner/subscription","commits_url":"https://api.github.com/repos/Storytel/react-redux-spinner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Storytel/react-redux-spinner/contents/{+path}","compare_url":"https://api.github.com/repos/Storytel/react-redux-spinner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Storytel/react-redux-spinner/merges","archive_url":"https://api.github.com/repos/Storytel/react-redux-spinner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Storytel/react-redux-spinner/downloads","issues_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues{/number}","pulls_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls{/number}","milestones_url":"https://api.github.com/repos/Storytel/react-redux-spinner/milestones{/number}","notifications_url":"https://api.github.com/repos/Storytel/react-redux-spinner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Storytel/react-redux-spinner/labels{/name}","releases_url":"https://api.github.com/repos/Storytel/react-redux-spinner/releases{/id}","deployments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/deployments","created_at":"2016-03-10T11:16:04Z","updated_at":"2018-12-29T05:28:16Z","pushed_at":"2019-01-03T14:09:40Z","git_url":"git://github.com/Storytel/react-redux-spinner.git","ssh_url":"git@github.com:Storytel/react-redux-spinner.git","clone_url":"https://github.com/Storytel/react-redux-spinner.git","svn_url":"https://github.com/Storytel/react-redux-spinner","homepage":"https://storytel.github.io/react-redux-spinner/","size":2823,"stargazers_count":74,"watchers_count":74,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":13,"open_issues":3,"watchers":74,"default_branch":"master"}},"base":{"label":"Storytel:master","ref":"master","sha":"2aa45812d3a80caea51bf16dd6daa31f42551eea","user":{"login":"Storytel","id":6998916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg5MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/6998916?v=4","gravatar_id":"","url":"https://api.github.com/users/Storytel","html_url":"https://github.com/Storytel","followers_url":"https://api.github.com/users/Storytel/followers","following_url":"https://api.github.com/users/Storytel/following{/other_user}","gists_url":"https://api.github.com/users/Storytel/gists{/gist_id}","starred_url":"https://api.github.com/users/Storytel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storytel/subscriptions","organizations_url":"https://api.github.com/users/Storytel/orgs","repos_url":"https://api.github.com/users/Storytel/repos","events_url":"https://api.github.com/users/Storytel/events{/privacy}","received_events_url":"https://api.github.com/users/Storytel/received_events","type":"Organization","site_admin":false},"repo":{"id":53578568,"node_id":"MDEwOlJlcG9zaXRvcnk1MzU3ODU2OA==","name":"react-redux-spinner","full_name":"Storytel/react-redux-spinner","private":false,"owner":{"login":"Storytel","id":6998916,"node_id":"MDEyOk9yZ2FuaXphdGlvbjY5OTg5MTY=","avatar_url":"https://avatars2.githubusercontent.com/u/6998916?v=4","gravatar_id":"","url":"https://api.github.com/users/Storytel","html_url":"https://github.com/Storytel","followers_url":"https://api.github.com/users/Storytel/followers","following_url":"https://api.github.com/users/Storytel/following{/other_user}","gists_url":"https://api.github.com/users/Storytel/gists{/gist_id}","starred_url":"https://api.github.com/users/Storytel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Storytel/subscriptions","organizations_url":"https://api.github.com/users/Storytel/orgs","repos_url":"https://api.github.com/users/Storytel/repos","events_url":"https://api.github.com/users/Storytel/events{/privacy}","received_events_url":"https://api.github.com/users/Storytel/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Storytel/react-redux-spinner","description":"An automatic spinner for react and redux","fork":false,"url":"https://api.github.com/repos/Storytel/react-redux-spinner","forks_url":"https://api.github.com/repos/Storytel/react-redux-spinner/forks","keys_url":"https://api.github.com/repos/Storytel/react-redux-spinner/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Storytel/react-redux-spinner/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Storytel/react-redux-spinner/teams","hooks_url":"https://api.github.com/repos/Storytel/react-redux-spinner/hooks","issue_events_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/events{/number}","events_url":"https://api.github.com/repos/Storytel/react-redux-spinner/events","assignees_url":"https://api.github.com/repos/Storytel/react-redux-spinner/assignees{/user}","branches_url":"https://api.github.com/repos/Storytel/react-redux-spinner/branches{/branch}","tags_url":"https://api.github.com/repos/Storytel/react-redux-spinner/tags","blobs_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/refs{/sha}","trees_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Storytel/react-redux-spinner/statuses/{sha}","languages_url":"https://api.github.com/repos/Storytel/react-redux-spinner/languages","stargazers_url":"https://api.github.com/repos/Storytel/react-redux-spinner/stargazers","contributors_url":"https://api.github.com/repos/Storytel/react-redux-spinner/contributors","subscribers_url":"https://api.github.com/repos/Storytel/react-redux-spinner/subscribers","subscription_url":"https://api.github.com/repos/Storytel/react-redux-spinner/subscription","commits_url":"https://api.github.com/repos/Storytel/react-redux-spinner/commits{/sha}","git_commits_url":"https://api.github.com/repos/Storytel/react-redux-spinner/git/commits{/sha}","comments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/comments{/number}","issue_comment_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/comments{/number}","contents_url":"https://api.github.com/repos/Storytel/react-redux-spinner/contents/{+path}","compare_url":"https://api.github.com/repos/Storytel/react-redux-spinner/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Storytel/react-redux-spinner/merges","archive_url":"https://api.github.com/repos/Storytel/react-redux-spinner/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Storytel/react-redux-spinner/downloads","issues_url":"https://api.github.com/repos/Storytel/react-redux-spinner/issues{/number}","pulls_url":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls{/number}","milestones_url":"https://api.github.com/repos/Storytel/react-redux-spinner/milestones{/number}","notifications_url":"https://api.github.com/repos/Storytel/react-redux-spinner/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Storytel/react-redux-spinner/labels{/name}","releases_url":"https://api.github.com/repos/Storytel/react-redux-spinner/releases{/id}","deployments_url":"https://api.github.com/repos/Storytel/react-redux-spinner/deployments","created_at":"2016-03-10T11:16:04Z","updated_at":"2018-12-29T05:28:16Z","pushed_at":"2019-01-03T14:09:40Z","git_url":"git://github.com/Storytel/react-redux-spinner.git","ssh_url":"git@github.com:Storytel/react-redux-spinner.git","clone_url":"https://github.com/Storytel/react-redux-spinner.git","svn_url":"https://github.com/Storytel/react-redux-spinner","homepage":"https://storytel.github.io/react-redux-spinner/","size":2823,"stargazers_count":74,"watchers_count":74,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":13,"mirror_url":null,"archived":false,"open_issues_count":3,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":13,"open_issues":3,"watchers":74,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29"},"html":{"href":"https://github.com/Storytel/react-redux-spinner/pull/29"},"issue":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/29"},"comments":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/issues/29/comments"},"review_comments":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29/comments"},"review_comment":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/pulls/29/commits"},"statuses":{"href":"https://api.github.com/repos/Storytel/react-redux-spinner/statuses/f20f8dd538d0dc1c233f978b6fe1ce351e1d9249"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"TimAstier"}}