Dispatch sends actions to stores through action creators – functions that emit specific actions when called. Unlike selectors that retrieve data, action creators modify application state by sending messages to the store.
Examples include closeGeneralSidebar()
and openGeneralSidebar()
for editor interface control, or removeBlock()
for content manipulation. These functions provide programmatic control over editor behavior and content.
All UI changes in the block editor result from dispatched actions. Understanding this pattern enables building blocks that interact with editor state, manipulate content, and integrate seamlessly with WordPress’s data management system.