background.ts: Introduce types for redux initialState

This commit is contained in:
Scott Nonnenberg
2022-02-23 10:48:40 -08:00
committed by GitHub
parent 3673b6d101
commit 4763831d3e
42 changed files with 315 additions and 238 deletions

View File

@@ -82,12 +82,12 @@ function updateOrCreate(
// Reducer
export function getInitialState(): BadgesStateType {
export function getEmptyState(): BadgesStateType {
return { byId: {} };
}
export function reducer(
state: Readonly<BadgesStateType> = getInitialState(),
state: Readonly<BadgesStateType> = getEmptyState(),
action: Readonly<ImageFileDownloadedActionType | UpdateOrCreateActionType>
): BadgesStateType {
switch (action.type) {