Skip to content
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

tests and fixes #457 #472

Merged
merged 3 commits into from
Aug 27, 2016
Merged

tests and fixes #457 #472

merged 3 commits into from
Aug 27, 2016

Conversation

jimbolla
Copy link
Contributor

No description provided.

@timdorr
Copy link
Member

timdorr commented Aug 24, 2016

Why did you close the other PR?


notify() {
current = next
for (let i = 0; i < count; i++) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please remove this count variable. It risks things getting out of sync somehow. Calling .length is just as fast, especially in engines like v8 that use hidden classes.

@jimbolla
Copy link
Contributor Author

github did it automatically when i deleted my branch and recreated it. I wanted to have the failing test before the fix so I was diddling with my git history. Ended up messing up my branches and just squashed the changes and recreated the branch.

@timdorr
Copy link
Member

timdorr commented Aug 24, 2016

You can just fix that locally and force push next time. A branch is just a pointer to a particular commit hash, and force pushing lets you change the remote branch/pointer to a commit not along the same chain. Github fixed handling that case a year or two ago, so it no longer loses all your comments and stuff like before.

{this.getChildComponent(this.state.location.pathname)}
</App>)
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From one of the react-router maintainers, this is a top quality mock router 😄

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. Easy to extend as well for the next person who wants to hoist it and have it take a map of route to component.

@@ -1,45 +1,61 @@
// encapsulates the subscription logic for connecting a component to the redux store, as
// well as nesting subscriptions of descendant components, so that we can ensure the
// ancestor components re-render before descendants
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a bit out of scope, but perhaps we can mention the whole current/next setup below and why it's structured that way, now that all the code is in one spot right below this. It's not super-obvious why you would do that just reading through (do we have tests for Subscription? That would be another way of documenting it.)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next/current pattern is straight out of the redux source. My hope is to eventually refactor that code into something reusable by the main store or Subscription.js

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know @acdlite wanted to do something like that in reduxjs/redux#1729, but it's gone inactive (although, @acdlite did just merge in some stuff on the upstream repo just a few hours ago...). Might be good to focus efforts there so we can use the exact same code in both places.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. My thought was to wait until these changes have landed, take care of any outstanding issues and let the dust settle before further tinkering.

@jimbolla
Copy link
Contributor Author

@timdorr Do you think this is ready for another alpha release?

@timdorr
Copy link
Member

timdorr commented Aug 27, 2016

Yeah, I'll do that right now.

@timdorr timdorr merged commit f54403a into reduxjs:next Aug 27, 2016
@timdorr
Copy link
Member

timdorr commented Aug 27, 2016

react-redux-5.0.0-beta.1 has been published to react-router@next!

@jimbolla jimbolla deleted the fix-457 branch September 14, 2016 00:35
webguru7 pushed a commit to webguru7/react-redux that referenced this pull request Dec 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants