From 98a88a827a85e4e1fdb0d6d5b47d58120d594e08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adam=20Zieli=C5=84ski?= Date: Thu, 26 Nov 2020 12:21:29 +0100 Subject: [PATCH] Use previous store definition --- packages/edit-post/src/store/index.js | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/packages/edit-post/src/store/index.js b/packages/edit-post/src/store/index.js index 7a029d0b934ef3..a2920a777cbaa6 100644 --- a/packages/edit-post/src/store/index.js +++ b/packages/edit-post/src/store/index.js @@ -1,7 +1,7 @@ /** * WordPress dependencies */ -import { createReduxStore, register } from '@wordpress/data'; +import { createReduxStore, registerStore } from '@wordpress/data'; /** * Internal dependencies @@ -12,6 +12,14 @@ import * as actions from './actions'; import * as selectors from './selectors'; import { STORE_NAME } from './constants'; +const storeConfig = { + reducer, + actions, + controls, + selectors, + persist: [ 'preferences' ], +}; + /** * Store definition for the edit post namespace. * @@ -19,14 +27,8 @@ import { STORE_NAME } from './constants'; * * @type {Object} */ -export const store = createReduxStore( STORE_NAME, { - reducer, - actions, - controls, - selectors, - persist: [ 'preferences' ], -} ); +export const store = createReduxStore( STORE_NAME, storeConfig ); // Ideally we use register instead of register store. // We shouuld be able to make the switch once we remove the effects. -register( store ); +registerStore( STORE_NAME, storeConfig );