mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-09-06 10:55:00 +08:00
♻️ Consolidate store initialization and exposure
This commit is contained in:
parent
6d81cf5139
commit
2818fd5d76
3 changed files with 13 additions and 6 deletions
|
@ -6,12 +6,8 @@ import SpinnerOverlay from './ReusableComponents/SpinnerOverlay';
|
||||||
import SendOnlyMessage from './Screens/SendOnlyMessage';
|
import SendOnlyMessage from './Screens/SendOnlyMessage';
|
||||||
import OnboardingScreen from './Screens/Onboarding';
|
import OnboardingScreen from './Screens/Onboarding';
|
||||||
import SettingsScreen from './Screens/Settings';
|
import SettingsScreen from './Screens/Settings';
|
||||||
import { initStore as initSettingsStore } from '../data/settings-tab';
|
|
||||||
import { useStore } from '../data/settings-tab/hooks';
|
import { useStore } from '../data/settings-tab/hooks';
|
||||||
|
|
||||||
// Initialize the settings store
|
|
||||||
initSettingsStore();
|
|
||||||
|
|
||||||
const SettingsApp = () => {
|
const SettingsApp = () => {
|
||||||
const onboardingProgress = OnboardingHooks.useSteps();
|
const onboardingProgress = OnboardingHooks.useSteps();
|
||||||
const { isReady: settingsIsReady } = useStore();
|
const { isReady: settingsIsReady } = useStore();
|
||||||
|
|
|
@ -1,24 +1,34 @@
|
||||||
import { addDebugTools } from './debug';
|
import { addDebugTools } from './debug';
|
||||||
import * as Onboarding from './onboarding';
|
import * as Onboarding from './onboarding';
|
||||||
import * as Common from './common';
|
import * as Common from './common';
|
||||||
import * as Styling from './styling';
|
|
||||||
import * as Payment from './payment';
|
import * as Payment from './payment';
|
||||||
|
import * as Settings from './settings-tab';
|
||||||
|
import * as Styling from './styling';
|
||||||
|
|
||||||
Onboarding.initStore();
|
Onboarding.initStore();
|
||||||
Common.initStore();
|
Common.initStore();
|
||||||
Payment.initStore();
|
Payment.initStore();
|
||||||
|
Settings.initStore();
|
||||||
Styling.initStore();
|
Styling.initStore();
|
||||||
|
|
||||||
export const OnboardingHooks = Onboarding.hooks;
|
export const OnboardingHooks = Onboarding.hooks;
|
||||||
export const CommonHooks = Common.hooks;
|
export const CommonHooks = Common.hooks;
|
||||||
export const PaymentHooks = Payment.hooks;
|
export const PaymentHooks = Payment.hooks;
|
||||||
|
export const SettingsHooks = Settings.hooks;
|
||||||
export const StylingHooks = Styling.hooks;
|
export const StylingHooks = Styling.hooks;
|
||||||
|
|
||||||
export const OnboardingStoreName = Onboarding.STORE_NAME;
|
export const OnboardingStoreName = Onboarding.STORE_NAME;
|
||||||
export const CommonStoreName = Common.STORE_NAME;
|
export const CommonStoreName = Common.STORE_NAME;
|
||||||
export const PaymentStoreName = Payment.STORE_NAME;
|
export const PaymentStoreName = Payment.STORE_NAME;
|
||||||
|
export const SettingsStoreName = Settings.STORE_NAME;
|
||||||
export const StylingStoreName = Styling.STORE_NAME;
|
export const StylingStoreName = Styling.STORE_NAME;
|
||||||
|
|
||||||
export * from './configuration';
|
export * from './configuration';
|
||||||
|
|
||||||
addDebugTools( window.ppcpSettings, [ Onboarding, Common, Payment, Styling ] );
|
addDebugTools( window.ppcpSettings, [
|
||||||
|
Onboarding,
|
||||||
|
Common,
|
||||||
|
Payment,
|
||||||
|
Settings,
|
||||||
|
Styling,
|
||||||
|
] );
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
|
|
||||||
import { createReduxStore, register } from '@wordpress/data';
|
import { createReduxStore, register } from '@wordpress/data';
|
||||||
import { controls as wpControls } from '@wordpress/data-controls';
|
import { controls as wpControls } from '@wordpress/data-controls';
|
||||||
|
|
||||||
import { STORE_NAME } from './constants';
|
import { STORE_NAME } from './constants';
|
||||||
import reducer from './reducer';
|
import reducer from './reducer';
|
||||||
import * as selectors from './selectors';
|
import * as selectors from './selectors';
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue