Replace remaining ramda references with shlinkio/data-manipulation

This commit is contained in:
Alejandro Celaya
2023-11-01 16:19:51 +01:00
parent 7ba78fd919
commit 8ad1e7e0d9
7 changed files with 18 additions and 38 deletions

View File

@@ -1,6 +1,6 @@
import { createAction, createSlice } from '@reduxjs/toolkit';
import { memoizeWith } from '@shlinkio/data-manipulation';
import type { ShlinkHealth } from '@shlinkio/shlink-web-component/api-contract';
import { memoizeWith } from 'ramda';
import type { ShlinkApiClientBuilder } from '../../api/services/ShlinkApiClientBuilder';
import { createAsyncThunk } from '../../utils/helpers/redux';
import { versionToPrintable, versionToSemVer as toSemVer } from '../../utils/helpers/version';

View File

@@ -1,5 +1,6 @@
import type { PayloadAction, PrepareAction } from '@reduxjs/toolkit';
import { createSlice } from '@reduxjs/toolkit';
import { mergeDeepRight } from '@shlinkio/data-manipulation';
import type { Theme } from '@shlinkio/shlink-frontend-kit';
import type {
Settings,
@@ -8,7 +9,6 @@ import type {
TagsSettings,
VisitsSettings,
} from '@shlinkio/shlink-web-component';
import { mergeDeepRight } from 'ramda';
import type { Defined } from '../../utils/types';
type ShortUrlsOrder = Defined<ShortUrlsListSettings['defaultOrdering']>;

View File

@@ -1,5 +1,5 @@
import { memoizeWith } from '@shlinkio/data-manipulation';
import { compare } from 'compare-versions';
import { memoizeWith } from 'ramda';
export type Empty = null | undefined | '' | never[];

View File

@@ -1,10 +1,6 @@
import { range } from 'ramda';
import type { SyntheticEvent } from 'react';
export const handleEventPreventingDefault = <T>(handler: () => T) => (e: SyntheticEvent) => {
e.preventDefault();
handler();
};
export const rangeOf = <T>(size: number, mappingFn: (value: number) => T, startAt = 1): T[] =>
range(startAt, size + 1).map(mappingFn);