Add type-alias-readonlydeep rule and make ducks mostly immutable
This commit is contained in:
parent
11ce3c3d59
commit
c58a723f45
47 changed files with 1164 additions and 871 deletions
|
@ -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 : []
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue