From 179b175d63d98115f31121e588015badaa82753b Mon Sep 17 00:00:00 2001 From: thelovekesh Date: Tue, 16 May 2023 02:03:16 +0530 Subject: [PATCH] Update store registration for block editor as `registerStore` is deprecated --- assets/src/block-editor/store/index.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/assets/src/block-editor/store/index.js b/assets/src/block-editor/store/index.js index 93d83f16938..d7f4f1ceb70 100644 --- a/assets/src/block-editor/store/index.js +++ b/assets/src/block-editor/store/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { registerStore } from '@wordpress/data'; +import { createReduxStore, register } from '@wordpress/data'; /** * Internal dependencies @@ -13,10 +13,12 @@ import * as selectors from './selectors'; */ const MODULE_KEY = 'amp/block-editor'; -export default registerStore(MODULE_KEY, { - reducer: (state) => state, - selectors, - initialState: { - ...window.ampBlockEditor, - }, -}); +export default register( + createReduxStore(MODULE_KEY, { + reducer: (state) => state, + selectors, + initialState: { + ...window.ampBlockEditor, + }, + }) +);