@wordpress/data learnup, cheatsheet and example app

What is @wordpress/data?

@wordpress/data is a state management library for JavaScript. It is used in the WordPress admin, and is available as a package in the WordPress npm registry.

Development

  • Requires Node.js v16 and npm v8.
  • npm install to install dependencies.
  • npm start to start the development server.

Cheatsheet

View the cheatsheet for a quick reference of terminology.

Learnup

View the learnup for a detailed explanation of the concepts and API. This is a Marp presentation, so you can view it in Marp or Marp for VS Code.

Example App

The @wordpress/data implementation of state management for @aprea's TicTacToe app is available in the src/data directory. Some modifications and additions were made to the component structure to resemble a large-scale app.

Check out the controls-resolvers branch to see additional players state with async selectors and resolvers.

Resources