@wordpress/blocks
Version:
Block API for WordPress.
19 lines (18 loc) • 509 B
JavaScript
// packages/blocks/src/api/categories.js
import { dispatch, select } from "@wordpress/data";
import { store as blocksStore } from "../store";
function getCategories() {
return select(blocksStore).getCategories();
}
function setCategories(categories) {
dispatch(blocksStore).setCategories(categories);
}
function updateCategory(slug, category) {
dispatch(blocksStore).updateCategory(slug, category);
}
export {
getCategories,
setCategories,
updateCategory
};
//# sourceMappingURL=categories.js.map