UNPKG

@gechiui/block-editor

Version:
45 lines (40 loc) 973 B
/** * GeChiUI dependencies */ import { createReduxStore, registerStore } from '@gechiui/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/GeChiUI/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/GeChiUI/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' ], } );