You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We should make use of the new REST endpoints created on our server so we can persist the data on refresh.
We can replace the use of the localStorage use in the datastore with using the REST endpoint instead.
Gutenberg has a handy npm package for this called api-fetch, more documentation on how to install and use is here.
As part of this you could create a simple component that fetches all the products on load and displays either the number of created items, or a list with the title of each product.
Make use of the Promise structure first .then(...
After doing this method try out the async/await way
We should make use of the new REST endpoints created on our server so we can persist the data on refresh.
We can replace the use of the localStorage use in the datastore with using the REST endpoint instead.
Gutenberg has a handy npm package for this called
api-fetch
, more documentation on how to install and use is here.As part of this you could create a simple component that fetches all the products on load and displays either the number of created items, or a list with the title of each product.
Make use of the Promise structure first
.then(...
After doing this method try out the async/await way
Acceptance criteria
The text was updated successfully, but these errors were encountered: