mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 09:08:09 +08:00
✨ Consistent storeInit and error handling logic
This commit is contained in:
parent
2818fd5d76
commit
7fad70d6e5
7 changed files with 67 additions and 33 deletions
|
@ -9,6 +9,12 @@ import * as hooks from './hooks';
|
|||
import { resolvers } from './resolvers';
|
||||
import { controls } from './controls';
|
||||
|
||||
/**
|
||||
* 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,
|
||||
|
@ -19,6 +25,8 @@ export const initStore = () => {
|
|||
} );
|
||||
|
||||
register( store );
|
||||
|
||||
return Boolean( wp.data.select( STORE_NAME ) );
|
||||
};
|
||||
|
||||
export { hooks, selectors, STORE_NAME };
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue