-
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
Themes: Add theme-details Redux subtree and data fetcher component #3011
Conversation
202a49d
to
61e2d79
Compare
4449cd9
to
6b97af8
Compare
@@ -65,5 +64,5 @@ export default connect( | |||
currentTheme: getCurrentTheme( state, props.site.ID ) | |||
} | |||
), | |||
bindActionCreators.bind( null, { fetchCurrentTheme } ) | |||
{ fetchCurrentTheme } |
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.
Why remove the binding? Doesn't this break fetching in refresh
?
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.
- [
mapDispatchToProps(dispatch, [ownProps]): dispatchProps
] (Object or Function): If an object is passed, each function inside it will be assumed to be a Redux action creator. An object with the same function names, but bound to a Redux store, will be merged into the component’s props.
So bindActionCreators
is apparently redundant here and can be safely dropped, since connect()
does the binding for us.
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.
Aha! I didn't remember that at all. :)
A confusing thing at the moment is that this new |
It is very tempting to introduce a new Elastic Search endpoint now to populate |
I went with the basic stuff that's required for #2875, tough it's obviously easy to add more fields as returned by the endpoint. I was just thinking adding them as we move forward made more sense than adding too many now and pruning back later. That said, we can add stuff like |
Yeah, that makes total sense. I'm more thinking of how do we answer the question, "what is the difference between themes and theme-details?" |
I agree however that the separation of concerns could be clearer, but to me that's more about refactoring |
yeah, totally agree |
}, | ||
|
||
refresh( props ) { | ||
if ( ! this.props.name && props.id ) { |
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.
what is the ! this.props.name
part for here?
The amount of boilerplate required to add a few fields to the store is mildly alarming. Regardless, this is looking good to go 👍 |
Looking at this again: would it have been advantageous to reuse the themes reducer (and actions?) and have the new That said, I don't mind merging this right now and leaving all that to a latter and larger tree consolidation effort. |
Use the REST API v1.1's /theme endpoint for now.
6b97af8
to
7cb9958
Compare
Use the REST API v1.1's /theme endpoint for now.
Relevant to #2875