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

Data: Add RegistryConsumer export #9042

Merged
merged 1 commit into from Aug 16, 2018
Merged

Data: Add RegistryConsumer export #9042

merged 1 commit into from Aug 16, 2018

Conversation

coderkevin
Copy link
Contributor

Description

The plugin code relies on the RegistryProvider to be able to add
functionality to the registry. withSelect uses the RegistryConsumer,
but code outside of @wordpress/data can't access this modified
registry at all (even though it can create it!).
This solves the incongruence by simply exporting RegistryConsumer as
well.

How has this been tested?

It's just an export so adding a test doesn't really make sense.
However, I have tested the export by using it here: woocommerce/woocommerce-admin#301

Types of changes

This isn't really a new feature and not quite a bug fix, but more an enhancement or correction.
It is not a breaking change.

Checklist:

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

The plugin code relies on the RegistryProvider to be able to add
functionality to the registry. `withSelect` uses the RegistryConsumer,
but code outside of `@wordpress/data` can't access this modified
registry at all (even though it can create it!).
This solves the incongruence by simply exporting RegistryConsumer as
well.
Copy link
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 👍

@youknowriad
Copy link
Contributor

I think we didn't know if people were going to create alternative HoCs instead of withSelect/withDispatch that's why it wasn't exported but it seems fine to me.

@youknowriad youknowriad added this to the 3.6 milestone Aug 16, 2018
@youknowriad youknowriad merged commit 3b9d23f into WordPress:master Aug 16, 2018
@coderkevin coderkevin deleted the add/registry-consumer-export branch August 16, 2018 17:45
@coderkevin
Copy link
Contributor Author

Thanks!

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.

None yet

2 participants