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