Add type-alias-readonlydeep rule and make ducks mostly immutable

This commit is contained in:
Jamie Kyle 2023-01-13 12:07:26 -08:00 committed by GitHub
parent 11ce3c3d59
commit c58a723f45
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
47 changed files with 1164 additions and 871 deletions

View file

@ -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 : []
);