Skip to content

Commit

Permalink
fix(frontend): type ignores for state persistance migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
mikonse committed Nov 10, 2023
1 parent 80a8bd2 commit ddd3dd0
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/libs/redux/src/lib/persistance.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { Action, AnyAction, ReducersMapObject } from "redux";
import { combineReducers } from "@reduxjs/toolkit";
import { persistReducer, createMigrate, type Storage, MigrationManifest } from "redux-persist";
import { accountReducer, accountMigrations, accountSliceVersion } from "./accounts";
import { transactionReducer, transactionMigrations, transactionSliceVersion } from "./transactions";
import { authReducer, authMigrations, authSliceVersion } from "./auth";
import { groupReducer, groupMigrations, groupSliceVersion } from "./groups";
import { Action, AnyAction, ReducersMapObject } from "redux";
import { MigrationManifest, createMigrate, persistReducer, type Storage } from "redux-persist";
import { accountMigrations, accountReducer, accountSliceVersion } from "./accounts";
import { authMigrations, authReducer, authSliceVersion } from "./auth";
import { groupMigrations, groupReducer, groupSliceVersion } from "./groups";
import { subscriptionReducer } from "./subscriptions";
import { transactionMigrations, transactionReducer, transactionSliceVersion } from "./transactions";

const getPersistConfig = (key: string, version: number, storage: Storage, migrations: MigrationManifest) => {
return {
Expand All @@ -22,18 +22,21 @@ export const getAbrechnungReducer = <S, A extends Action = AnyAction>(
) => {
return combineReducers({
accounts: persistReducer(
getPersistConfig("accounts", accountSliceVersion, persistStorage, accountMigrations),
getPersistConfig("accounts", accountSliceVersion, persistStorage, accountMigrations as any),

Check warning on line 25 in frontend/libs/redux/src/lib/persistance.ts

View workflow job for this annotation

GitHub Actions / build_and_test_frontend / lint

Unexpected any. Specify a different type
accountReducer
),
groups: persistReducer(
getPersistConfig("groups", groupSliceVersion, persistStorage, groupMigrations),
getPersistConfig("groups", groupSliceVersion, persistStorage, groupMigrations as any),

Check warning on line 29 in frontend/libs/redux/src/lib/persistance.ts

View workflow job for this annotation

GitHub Actions / build_and_test_frontend / lint

Unexpected any. Specify a different type
groupReducer
),
transactions: persistReducer(
getPersistConfig("transactions", transactionSliceVersion, persistStorage, transactionMigrations),
getPersistConfig("transactions", transactionSliceVersion, persistStorage, transactionMigrations as any),

Check warning on line 33 in frontend/libs/redux/src/lib/persistance.ts

View workflow job for this annotation

GitHub Actions / build_and_test_frontend / lint

Unexpected any. Specify a different type
transactionReducer
),
auth: persistReducer(getPersistConfig("auth", authSliceVersion, persistStorage, authMigrations), authReducer),
auth: persistReducer(
getPersistConfig("auth", authSliceVersion, persistStorage, authMigrations as any),

Check warning on line 37 in frontend/libs/redux/src/lib/persistance.ts

View workflow job for this annotation

GitHub Actions / build_and_test_frontend / lint

Unexpected any. Specify a different type
authReducer
),
subscriptions: subscriptionReducer,
...additionalReducers,
});
Expand Down

0 comments on commit ddd3dd0

Please sign in to comment.