Roughly three years ago I started writing a series of posts on the
wp.data API. Little did I know how valuable this post would be to so many people within the WordPress community (and at my current employer Automattic)! Of course, as it is with all APIs, changes happen and while the content of the series is still applicable and works, it does need updating. So for the next couple months I’m going to take some time to update the series with all the new interfaces and changes that bring up to date.
Today, however, I completed the first update to the series and it was replacing a broken part of the demo apps referenced throughout. When I first wrote these posts, I utilized a service called jsonbox.io to help facilitate simulating communicating with a backend for data. But for about a year, it has not been available which meant a good portion of the demo apps didn’t work. Although there are a number of other options they either required self-hosting, or had rate-limiting, or CORs issues. The latter two being problematic because the demo app is hosted on codesandbox.io.
I thought I might have to code my own solution until I came across dummyjson.com. This actually ended up being a really great option because it’s just an API mock service (with products!) which meant that the chances of it being rate-limited or unavailable in the future are slimmer. Perfect for the use-case.
Anyways, I updated the app examples to use this new service and the relevant posts in the
wp.data series. Enjoy!