-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
State: Move followers to redux #5248
Conversation
9e24f8e
to
dc2c905
Compare
This may need a rebase, I'm seeing a lot of persistent redux schema errors in the browser console. Otherwise the included tests are working for me 👍 |
export const FOLLOWER_REMOVE_REQUEST = 'FOLLOWER_REMOVE_REQUEST'; | ||
export const FOLLOWER_REMOVE_ERROR = 'FOLLOWER_REMOVE_ERROR'; | ||
export const FOLLOWER_REMOVE_SUCCESS = 'FOLLOWER_REMOVE_SUCCESS'; | ||
export const FOLLOWERS_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be:
-export const FOLLOWERS_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE';
+export const FOLLOWERS_REQUEST_RECEIVE = 'FOLLOWERS_REQUEST_RECEIVE';
dc2c905
to
c94e13c
Compare
Thanks for the review @jordwest ! I pushed a commit to address your helpful feedback. |
removeFollower( siteId, follower ) { | ||
return ( dispatch ) => { | ||
debug( 'removing follower', follower, siteId ); | ||
// TODO: replace REMOVE_FOLLOWER with FOLLOWER_REMOVE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this TODO can also be removed
Looks good! 🚢 |
3d843f6
to
836aa88
Compare
This PR creates a folder in 'client/state' which will eventually replace the Flux implementation in 'client/lib/followers' with a Redux implementation. The Redux data is not yet being used anywhere; that will happen in an other PR that implements a `queryFollowers` component. I wrote a few tests, mostly to help ensure that the data is being properly stored in the tree.
`queries` will now contain `ids`, `total`, and `lastPage` as opposed to having separate closures for `total` and `lastPage`. This makes it easier to update totals when a follower is removed from the site.
Addressing feedback from @jordwest - improve syntax, remove TODOs
836aa88
to
4d01a32
Compare
Moves followers to the redux state. See #5046
This PR creates a branch in the redux tree for followers. It does NOT yet make use of this data in any UI components. A separate PR will handle a
queryFollowers
component to replace the current Flux implementation.To test:
npm run test
and ensure all follower tests are passingstate/followers/test/reducer.js
,state/followers/test/selectors.js
, andstate/followers/test/utils.js
change the top leveldescribe()
todescribe.only()
to run just the follower testsCheck for regressions
Because I made a small change to a WPCOM api method, ensure that removing people still works. Select a site, go to People, select a Team member or Follower, and ensure that you can remove them from the site.
cc: @ebinnion @lezama