-
Notifications
You must be signed in to change notification settings - Fork 4.2k
/
index.js
44 lines (40 loc) · 981 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/**
* WordPress dependencies
*/
import { createReduxStore, registerStore } from '@wordpress/data';
/**
* Internal dependencies
*/
import reducer from './reducer';
import * as selectors from './selectors';
import * as actions from './actions';
import { STORE_NAME } from './constants';
/**
* Block editor data store configuration.
*
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#registerStore
*
* @type {Object}
*/
export const storeConfig = {
reducer,
selectors,
actions,
__experimentalUseThunks: true,
};
/**
* Store definition for the block editor namespace.
*
* @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/data/README.md#createReduxStore
*
* @type {Object}
*/
export const store = createReduxStore( STORE_NAME, {
...storeConfig,
persist: [ 'preferences' ],
} );
// Ideally we'd use register instead of register stores.
registerStore( STORE_NAME, {
...storeConfig,
persist: [ 'preferences' ],
} );