From 19bb9fe4b3da094f92d9d0b32ea408faebbe1ed4 Mon Sep 17 00:00:00 2001 From: Ella Date: Fri, 17 Nov 2023 15:48:29 +0100 Subject: [PATCH] Don't use deprecated fn --- docs/reference-guides/data/data-core-editor.md | 4 ---- packages/editor/src/store/selectors.js | 6 ++---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/docs/reference-guides/data/data-core-editor.md b/docs/reference-guides/data/data-core-editor.md index 5dbcb095bbf08..db70d29c16696 100644 --- a/docs/reference-guides/data/data-core-editor.md +++ b/docs/reference-guides/data/data-core-editor.md @@ -321,10 +321,6 @@ _Returns_ Return the current block list. -_Parameters_ - -- _state_ `Object`: - _Returns_ - `Array`: Block list. diff --git a/packages/editor/src/store/selectors.js b/packages/editor/src/store/selectors.js index d82e5ecb16e06..d44e5ae6f0f87 100644 --- a/packages/editor/src/store/selectors.js +++ b/packages/editor/src/store/selectors.js @@ -1097,12 +1097,10 @@ export const isPublishSidebarEnabled = createRegistrySelector( /** * Return the current block list. * - * @param {Object} state * @return {Array} Block list. */ -export const getEditorBlocks = createSelector( - () => getBlocks(), - () => [ getBlocks() ] +export const getEditorBlocks = createRegistrySelector( + ( select ) => () => select( blockEditorStore ).getBlocks() ); /**