API: Replace all withAPIData usage and deprecate the HoC#8584
Conversation
| order, | ||
| orderby: orderBy, | ||
| per_page: postsToShow, | ||
| _fields: [ 'date_gmt', 'link', 'title' ], |
There was a problem hiding this comment.
We are going to fetch more data, is that expected?
There was a problem hiding this comment.
yes, with a central store like we do right now, we can't fetch a small part of objects, we fetch the whole objects or we don't. Because the redux state always expects the full object.
There was a problem hiding this comment.
We could, but it is super complex :)
|
Eslint complains
Unit test fails:
Otherwise everything works perfectly fine. |
| } | ||
|
|
||
| /** | ||
| * Returns the list of the taxonomies entities. |
There was a problem hiding this comment.
Nit: The function returns a promise. The promise resolves to a list of the taxonomies entities.
Aside: This is probably one of the only things I dislike about async / await, that it becomes very non-obvious that it will always return a Promise (I think even if the function has no return statement? My uncertainty reenforces my point 😄 ).
This PR removes the remaining usage of withAPIData from Gutenberg and officially deprecate its usage.
Testing instructions
closes #7397
closes #6277
closes #6379
closes #6537