Fix import cycles
[MAILPOET-3915]
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
export * from './settings';
|
||||
export * from './key_activation';
|
||||
export * from './mss_and_premium';
|
||||
export { default as reinstall } from './reinstall';
|
||||
export { recalculateSubscribersScore } from './recalculate_subscribers_score';
|
||||
|
@@ -0,0 +1,5 @@
|
||||
import { Action, KeyActivationState } from '../types';
|
||||
|
||||
export function updateKeyActivationState(fields: Partial<KeyActivationState>): Action {
|
||||
return { type: 'UPDATE_KEY_ACTIVATION_STATE', fields };
|
||||
}
|
@@ -1,17 +1,12 @@
|
||||
import { select } from '@wordpress/data';
|
||||
|
||||
import MailPoet from 'mailpoet';
|
||||
import { STORE_NAME } from 'settings/store';
|
||||
|
||||
import {
|
||||
Action, KeyActivationState, MssStatus, PremiumStatus,
|
||||
} from 'settings/store/types';
|
||||
import { STORE_NAME } from 'settings/store/store_name';
|
||||
import { KeyActivationState, MssStatus, PremiumStatus } from 'settings/store/types';
|
||||
import { updateKeyActivationState } from './key_activation';
|
||||
import { setSettings, setSetting } from './settings';
|
||||
|
||||
export function updateKeyActivationState(fields: Partial<KeyActivationState>): Action {
|
||||
return { type: 'UPDATE_KEY_ACTIVATION_STATE', fields };
|
||||
}
|
||||
|
||||
export function* verifyMssKey(key: string) {
|
||||
const { success, error, res } = yield {
|
||||
type: 'CALL_API',
|
||||
|
@@ -1,8 +1,8 @@
|
||||
import { select } from '@wordpress/data';
|
||||
|
||||
import { STORE_NAME } from 'settings/store';
|
||||
import { STORE_NAME } from 'settings/store/store_name';
|
||||
import { Action, ReEngagement } from 'settings/store/types';
|
||||
import { updateKeyActivationState } from './mss_and_premium';
|
||||
import { updateKeyActivationState } from './key_activation';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export function setSetting(path: string[], value: any): Action {
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import MailPoet from 'mailpoet';
|
||||
import { select } from '@wordpress/data';
|
||||
import { STORE_NAME } from '.';
|
||||
import { STORE_NAME } from './store_name';
|
||||
|
||||
export { default as CALL_API } from 'common/controls/call_api';
|
||||
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import { useDispatch } from '@wordpress/data';
|
||||
import * as actions from '../actions';
|
||||
import { STORE_NAME } from '..';
|
||||
import { STORE_NAME } from '../store_name';
|
||||
|
||||
type Actions = typeof actions;
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { useSelect } from '@wordpress/data';
|
||||
import { STORE_NAME } from '..';
|
||||
import { STORE_NAME } from '../store_name';
|
||||
import * as selectors from '../selectors';
|
||||
import { ExcludeFirstParam } from './types';
|
||||
|
||||
|
@@ -4,8 +4,7 @@ import * as selectors from './selectors';
|
||||
import * as controls from './controls';
|
||||
import createReducer from './create_reducer';
|
||||
import makeDefaultState from './make_default_state';
|
||||
|
||||
export const STORE_NAME = 'mailpoet-settings';
|
||||
import { STORE_NAME } from './store_name';
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export const initStore = (window: any) => registerStore(STORE_NAME, {
|
||||
|
1
mailpoet/assets/js/src/settings/store/store_name.ts
Normal file
1
mailpoet/assets/js/src/settings/store/store_name.ts
Normal file
@@ -0,0 +1 @@
|
||||
export const STORE_NAME = 'mailpoet-settings';
|
Reference in New Issue
Block a user