Skip to content

Data: Refactor query HOC usage with withSelect#5215

Merged
gziolo merged 1 commit intomasterfrom
update/query-with-select
Feb 23, 2018
Merged

Data: Refactor query HOC usage with withSelect#5215
gziolo merged 1 commit intomasterfrom
update/query-with-select

Conversation

@gziolo
Copy link
Copy Markdown
Member

@gziolo gziolo commented Feb 23, 2018

Description

There are a few deprecations warnings on the JS console coming from query HOC. This PR refactors all code occurrences to use new withSelect HOC.

How Has This Been Tested?

Make sure there are no warnings on the JS console and there are no regressions.

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code has proper inline documentation.

@gziolo gziolo added the [Feature] UI Components Impacts or related to the UI component system label Feb 23, 2018
@gziolo gziolo self-assigned this Feb 23, 2018
@gziolo gziolo requested a review from a team February 23, 2018 12:41
query( ( select ) => ( {
withSelect( ( select ) => ( {
count: select( 'core/editor' ).getSelectedBlockCount(),
} ) ),
Copy link
Copy Markdown
Member Author

@gziolo gziolo Feb 23, 2018

Choose a reason for hiding this comment

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

connect should go next as soon as we expose all selectors and actions :)

Copy link
Copy Markdown
Contributor

@youknowriad youknowriad left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@gziolo gziolo merged commit eba2144 into master Feb 23, 2018
@gziolo gziolo deleted the update/query-with-select branch February 23, 2018 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Feature] UI Components Impacts or related to the UI component system

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants