Skip to content

Commit

Permalink
Update store registration for block editor as registerStore is depr…
Browse files Browse the repository at this point in the history
…ecated
  • Loading branch information
thelovekesh committed May 15, 2023
1 parent 45e9ac9 commit 179b175
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions assets/src/block-editor/store/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { registerStore } from '@wordpress/data';
import { createReduxStore, register } from '@wordpress/data';

/**
* Internal dependencies
Expand All @@ -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,
},
})
);

0 comments on commit 179b175

Please sign in to comment.