Skip to content

Commit

Permalink
fix(react-redux-hydrogen): don't call query if we just transitioned t…
Browse files Browse the repository at this point in the history
…o not waiting
  • Loading branch information
RickEyre committed Oct 3, 2018
1 parent 0cff705 commit e86c394
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/react-redux-hydrogen/src/hydrogenize.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,12 @@ export const hydrogenize = (
),
lifecycle({
componentWillReceiveProps(nextProps) {
const { query } = extractOptions(options);
const { query, wait } = extractOptions(options);
if (
nextProps.hydrogenMeta.shouldRequest &&
!isEqual(query(this.props), query(nextProps))
nextProps.hydrogenMeta.shouldRequest && (
(wait(this.props) && !wait(nextProps)) ||
!isEqual(query(this.props), query(nextProps))
)
) {
hydrogen.service(name)[method](query(nextProps))(nextProps.dispatch);
}
Expand Down

0 comments on commit e86c394

Please sign in to comment.