Skip to content

Commit

Permalink
Use previous store definition
Browse files Browse the repository at this point in the history
  • Loading branch information
adamziel committed Nov 26, 2020
1 parent eb03159 commit 98a88a8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions packages/edit-post/src/store/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* WordPress dependencies
*/
import { createReduxStore, register } from '@wordpress/data';
import { createReduxStore, registerStore } from '@wordpress/data';

/**
* Internal dependencies
Expand All @@ -12,21 +12,23 @@ 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.
*
* @see https://github.com/WordPress/gutenberg/blob/master/packages/data/README.md#createReduxStore
*
* @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 );

0 comments on commit 98a88a8

Please sign in to comment.