mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 13:44:42 +08:00
30 lines
843 B
JavaScript
30 lines
843 B
JavaScript
import { createReduxStore, register } from '@wordpress/data';
|
|
|
|
import { STORE_NAME } from './constants';
|
|
import reducer from './reducer';
|
|
import * as selectors from './selectors';
|
|
import * as actions from './actions';
|
|
import * as thunkActions from './actions-thunk';
|
|
import * as hooks from './hooks';
|
|
import * as resolvers from './resolvers';
|
|
|
|
/**
|
|
* Initializes and registers the settings store with WordPress data layer.
|
|
* Combines custom controls with WordPress data controls.
|
|
*
|
|
* @return {boolean} True if initialization succeeded, false otherwise.
|
|
*/
|
|
export const initStore = () => {
|
|
const store = createReduxStore( STORE_NAME, {
|
|
reducer,
|
|
actions: { ...actions, ...thunkActions },
|
|
selectors,
|
|
resolvers,
|
|
} );
|
|
|
|
register( store );
|
|
|
|
return Boolean( wp.data.select( STORE_NAME ) );
|
|
};
|
|
|
|
export { hooks, selectors, STORE_NAME };
|