Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Propose useEntityRecords (experimental) #38782
Propose useEntityRecords (experimental) #38782
Changes from all commits
5654efa
6b0e67c
2246075
2a93ed2
179e77f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
how hard would it be to surface a type of
queryArgs
here from wherever it's consumed? if not, can we add a link in the JSDoc comment to point people to where they can find out? I know it's passed-through togetEntityRecords
butunknown
isn't that helpful.Given that these are just passed through we might be able to reuse the types from
getEntityRecords
. I'm curious if the rename fromdata
torecords
is fully worth it considering that it incurs a needless object clone, but I get how it's nice to match withuseEntityRecord
EntityRecordHook.mov
playground link
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.
Good idea! The
EntityQuery
type from #40024 would make a good fit here once that PR lands.It doesn't match, though 😅 it is
record
andrecords
. The reason I went for that versusdata
is for the sake of the consumer of this hook. Referring to arecord
inside of a component is clearer than referring to an opaquedata
. I am not a fan of that destructuring, though.