Add type-alias-readonlydeep rule and make ducks mostly immutable
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import { createSelector } from 'reselect';
|
||||
import type { ReadonlyDeep } from 'type-fest';
|
||||
import type { MediaItemType } from '../../types/MediaItem';
|
||||
import type { StateType } from '../reducer';
|
||||
import type { LightboxStateType } from '../ducks/lightbox';
|
||||
@@ -36,6 +37,6 @@ export const getSelectedIndex = createSelector(
|
||||
|
||||
export const getMedia = createSelector(
|
||||
getLightboxState,
|
||||
(state): ReadonlyArray<MediaItemType> =>
|
||||
(state): ReadonlyArray<ReadonlyDeep<MediaItemType>> =>
|
||||
state.isShowingLightbox ? state.media : []
|
||||
);
|
||||
|
@@ -125,7 +125,7 @@ export const getRecentStickers = createSelector(
|
||||
getStickersPath,
|
||||
getTempPath,
|
||||
(
|
||||
recents: Array<RecentStickerType>,
|
||||
recents: ReadonlyArray<RecentStickerType>,
|
||||
packs: Dictionary<StickerPackDBType>,
|
||||
stickersPath: string,
|
||||
tempPath: string
|
||||
|
Reference in New Issue
Block a user