From 05adf3712cbc06fb0079c28ea96a29aff2d7b035 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ella=20van=C2=A0Durpe?= Date: Wed, 19 May 2021 11:21:36 +0300 Subject: [PATCH] Revert "Replace string literals with store definitions in block-library (#31933)" This reverts commit b122f241589ed20c5f1cb888ff770b6604816e00. --- packages/block-library/src/categories/edit.js | 4 ++-- packages/block-library/src/embed/edit.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/block-library/src/categories/edit.js b/packages/block-library/src/categories/edit.js index efb499ddef1a2e..12adf03e1ffcee 100644 --- a/packages/block-library/src/categories/edit.js +++ b/packages/block-library/src/categories/edit.js @@ -14,7 +14,7 @@ import { VisuallyHidden, } from '@wordpress/components'; import { useInstanceId } from '@wordpress/compose'; -import { useSelect, store as dataStore } from '@wordpress/data'; +import { useSelect } from '@wordpress/data'; import { InspectorControls, useBlockProps } from '@wordpress/block-editor'; import { __ } from '@wordpress/i18n'; import { pin } from '@wordpress/icons'; @@ -27,7 +27,7 @@ export default function CategoriesEdit( { const selectId = useInstanceId( CategoriesEdit, 'blocks-category-select' ); const { categories, isRequesting } = useSelect( ( select ) => { const { getEntityRecords } = select( coreStore ); - const { isResolving } = select( dataStore ); + const { isResolving } = select( 'core/data' ); const query = { per_page: -1, hide_empty: true }; return { categories: getEntityRecords( 'taxonomy', 'category', query ), diff --git a/packages/block-library/src/embed/edit.js b/packages/block-library/src/embed/edit.js index 0bcabc5cf57c25..a02371c0d4c637 100644 --- a/packages/block-library/src/embed/edit.js +++ b/packages/block-library/src/embed/edit.js @@ -24,7 +24,7 @@ import classnames from 'classnames'; */ import { __, _x, sprintf } from '@wordpress/i18n'; import { useState, useEffect, Platform } from '@wordpress/element'; -import { useDispatch, useSelect, store as dataStore } from '@wordpress/data'; +import { useDispatch, useSelect } from '@wordpress/data'; import { useBlockProps } from '@wordpress/block-editor'; import { store as coreStore } from '@wordpress/core-data'; import { View } from '@wordpress/primitives'; @@ -64,7 +64,7 @@ const EmbedEdit = ( props ) => { const [ url, setURL ] = useState( attributesUrl ); const [ isEditingURL, setIsEditingURL ] = useState( false ); - const { invalidateResolution } = useDispatch( dataStore ); + const { invalidateResolution } = useDispatch( 'core/data' ); const { preview,