mirror of
https://github.com/shlinkio/shlink-web-client.git
synced 2026-03-10 09:33:51 +00:00
Create dedicated store module
This commit is contained in:
@@ -3,8 +3,8 @@ import { Provider } from 'react-redux';
|
|||||||
import { BrowserRouter } from 'react-router';
|
import { BrowserRouter } from 'react-router';
|
||||||
import pack from '../package.json';
|
import pack from '../package.json';
|
||||||
import { container } from './container';
|
import { container } from './container';
|
||||||
import { setUpStore } from './container/store';
|
|
||||||
import { register as registerServiceWorker } from './serviceWorkerRegistration';
|
import { register as registerServiceWorker } from './serviceWorkerRegistration';
|
||||||
|
import { setUpStore } from './store';
|
||||||
import './tailwind.css';
|
import './tailwind.css';
|
||||||
|
|
||||||
const store = setUpStore();
|
const store = setUpStore();
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import { memoizeWith } from '@shlinkio/data-manipulation';
|
|||||||
import type { ShlinkHealth } from '@shlinkio/shlink-web-component/api-contract';
|
import type { ShlinkHealth } from '@shlinkio/shlink-web-component/api-contract';
|
||||||
import { useCallback } from 'react';
|
import { useCallback } from 'react';
|
||||||
import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';
|
import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';
|
||||||
import { useAppDispatch, useAppSelector } from '../../container/store';
|
import { useAppDispatch, useAppSelector } from '../../store';
|
||||||
import { createAsyncThunk } from '../../utils/helpers/redux';
|
import { createAsyncThunk } from '../../utils/helpers/redux';
|
||||||
import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version';
|
import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version';
|
||||||
import type { SelectedServer, ServerWithId } from '../data';
|
import type { SelectedServer, ServerWithId } from '../data';
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ import { configureStore } from '@reduxjs/toolkit';
|
|||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import type { RLSOptions } from 'redux-localstorage-simple';
|
import type { RLSOptions } from 'redux-localstorage-simple';
|
||||||
import { load, save } from 'redux-localstorage-simple';
|
import { load, save } from 'redux-localstorage-simple';
|
||||||
import { initReducers } from '../reducers';
|
import type { ShlinkState } from '../container/types';
|
||||||
import { migrateDeprecatedSettings } from '../settings/helpers';
|
import { migrateDeprecatedSettings } from '../settings/helpers';
|
||||||
import type { ShlinkState } from './types';
|
import { initReducers } from './reducers';
|
||||||
|
|
||||||
const localStorageConfig: RLSOptions = {
|
const localStorageConfig: RLSOptions = {
|
||||||
states: ['settings', 'servers'],
|
states: ['settings', 'servers'],
|
||||||
@@ -3,8 +3,8 @@ import { render } from '@testing-library/react';
|
|||||||
import userEvent from '@testing-library/user-event';
|
import userEvent from '@testing-library/user-event';
|
||||||
import type { PropsWithChildren, ReactElement } from 'react';
|
import type { PropsWithChildren, ReactElement } from 'react';
|
||||||
import { Provider } from 'react-redux';
|
import { Provider } from 'react-redux';
|
||||||
import { setUpStore } from '../../src/container/store';
|
|
||||||
import type { ShlinkState } from '../../src/container/types';
|
import type { ShlinkState } from '../../src/container/types';
|
||||||
|
import { setUpStore } from '../../src/store';
|
||||||
|
|
||||||
export const renderWithEvents = (element: ReactElement, options?: RenderOptions) => ({
|
export const renderWithEvents = (element: ReactElement, options?: RenderOptions) => ({
|
||||||
user: userEvent.setup(),
|
user: userEvent.setup(),
|
||||||
|
|||||||
Reference in New Issue
Block a user