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
47 changed files with 1164 additions and 871 deletions

View File

@@ -3,6 +3,7 @@
import type { ThunkAction } from 'redux-thunk';
import type { ReadonlyDeep } from 'type-fest';
import * as Errors from '../../types/errors';
import * as log from '../../logging/log';
@@ -16,21 +17,21 @@ import type { NoopActionType } from './noop';
// State
export type AccountsStateType = {
export type AccountsStateType = ReadonlyDeep<{
accounts: Record<string, UUIDStringType | undefined>;
};
}>;
// Actions
type AccountUpdateActionType = {
type AccountUpdateActionType = ReadonlyDeep<{
type: 'accounts/UPDATE';
payload: {
phoneNumber: string;
uuid?: UUIDStringType;
};
};
}>;
export type AccountsActionType = AccountUpdateActionType;
export type AccountsActionType = ReadonlyDeep<AccountUpdateActionType>;
// Action Creators