Skip to content

Commit eff2318

Browse files
EvanHahn-Signaljosh-signal
authored andcommitted
Minor: mark reducer arguments as Readonly
1 parent 0c99604 commit eff2318

File tree

11 files changed

+23
-23
lines changed

11 files changed

+23
-23
lines changed

ts/state/ducks/calling.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -914,7 +914,7 @@ function getExistingPeekInfo(
914914
}
915915

916916
function removeConversationFromState(
917-
state: CallingStateType,
917+
state: Readonly<CallingStateType>,
918918
conversationId: string
919919
): CallingStateType {
920920
return {
@@ -926,8 +926,8 @@ function removeConversationFromState(
926926
}
927927

928928
export function reducer(
929-
state: CallingStateType = getEmptyState(),
930-
action: CallingActionType
929+
state: Readonly<CallingStateType> = getEmptyState(),
930+
action: Readonly<CallingActionType>
931931
): CallingStateType {
932932
const { callsByConversation } = state;
933933

ts/state/ducks/conversations.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -811,8 +811,8 @@ function hasMessageHeightChanged(
811811
}
812812

813813
export function reducer(
814-
state: ConversationsStateType = getEmptyState(),
815-
action: ConversationActionType
814+
state: Readonly<ConversationsStateType> = getEmptyState(),
815+
action: Readonly<ConversationActionType>
816816
): ConversationsStateType {
817817
if (action.type === 'CONVERSATION_ADDED') {
818818
const { payload } = action;

ts/state/ducks/emojis.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ function getEmptyState(): EmojisStateType {
6262
}
6363

6464
export function reducer(
65-
state: EmojisStateType = getEmptyState(),
66-
action: EmojisActionType
65+
state: Readonly<EmojisStateType> = getEmptyState(),
66+
action: Readonly<EmojisActionType>
6767
): EmojisStateType {
6868
if (action.type === 'emojis/USE_EMOJI') {
6969
const { payload } = action;

ts/state/ducks/expiration.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,8 @@ function getEmptyState(): ExpirationStateType {
4040
}
4141

4242
export function reducer(
43-
state: ExpirationStateType = getEmptyState(),
44-
action: ExpirationActionType
43+
state: Readonly<ExpirationStateType> = getEmptyState(),
44+
action: Readonly<ExpirationActionType>
4545
): ExpirationStateType {
4646
if (action.type === HYDRATE_EXPIRATION_STATUS) {
4747
return {

ts/state/ducks/items.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@ function getEmptyState(): ItemsStateType {
109109
}
110110

111111
export function reducer(
112-
state: ItemsStateType = getEmptyState(),
113-
action: ItemsActionType
112+
state: Readonly<ItemsStateType> = getEmptyState(),
113+
action: Readonly<ItemsActionType>
114114
): ItemsStateType {
115115
if (action.type === 'items/PUT_EXTERNAL') {
116116
const { payload } = action;

ts/state/ducks/network.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,8 +83,8 @@ function getEmptyState(): NetworkStateType {
8383
}
8484

8585
export function reducer(
86-
state: NetworkStateType = getEmptyState(),
87-
action: NetworkActionType
86+
state: Readonly<NetworkStateType> = getEmptyState(),
87+
action: Readonly<NetworkActionType>
8888
): NetworkStateType {
8989
if (action.type === CHECK_NETWORK_STATUS) {
9090
const { isOnline, socketStatus } = action.payload;

ts/state/ducks/safetyNumber.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ function getEmptyState(): SafetyNumberStateType {
163163
}
164164

165165
export function reducer(
166-
state: SafetyNumberStateType = getEmptyState(),
167-
action: SafetyNumberActionType
166+
state: Readonly<SafetyNumberStateType> = getEmptyState(),
167+
action: Readonly<SafetyNumberActionType>
168168
): SafetyNumberStateType {
169169
if (action.type === TOGGLE_VERIFIED_PENDING) {
170170
const { contact } = action.payload;

ts/state/ducks/search.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -337,8 +337,8 @@ function getEmptyState(): SearchStateType {
337337
}
338338

339339
export function reducer(
340-
state: SearchStateType = getEmptyState(),
341-
action: SearchActionType
340+
state: Readonly<SearchStateType> = getEmptyState(),
341+
action: Readonly<SearchActionType>
342342
): SearchStateType {
343343
if (action.type === 'SHOW_ARCHIVED_CONVERSATIONS') {
344344
return getEmptyState();

ts/state/ducks/stickers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,8 +373,8 @@ function getEmptyState(): StickersStateType {
373373
}
374374

375375
export function reducer(
376-
state: StickersStateType = getEmptyState(),
377-
action: StickersActionType
376+
state: Readonly<StickersStateType> = getEmptyState(),
377+
action: Readonly<StickersActionType>
378378
): StickersStateType {
379379
if (action.type === 'stickers/STICKER_PACK_ADDED') {
380380
// ts complains due to `stickers: {}` being overridden by the payload

ts/state/ducks/updates.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,8 +111,8 @@ function getEmptyState(): UpdatesStateType {
111111
}
112112

113113
export function reducer(
114-
state: UpdatesStateType = getEmptyState(),
115-
action: UpdatesActionType
114+
state: Readonly<UpdatesStateType> = getEmptyState(),
115+
action: Readonly<UpdatesActionType>
116116
): UpdatesStateType {
117117
if (action.type === SHOW_UPDATE_DIALOG) {
118118
return {

0 commit comments

Comments
 (0)