From 56728a85190682a65c3bbc2cd39dcb61ebfbfdf5 Mon Sep 17 00:00:00 2001 From: Siarhei Karol Date: Thu, 12 Dec 2024 12:23:02 +0300 Subject: [PATCH] types fixed --- src/store/utils/createStoreFactory.ts | 4 ++-- src/store/utils/slice.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/store/utils/createStoreFactory.ts b/src/store/utils/createStoreFactory.ts index 7b4bfdac..e53e4d6a 100644 --- a/src/store/utils/createStoreFactory.ts +++ b/src/store/utils/createStoreFactory.ts @@ -1,7 +1,7 @@ import { createBaseSlice, type SliceState } from './slice'; import { generateStore, type StateCreatorTyped } from './storeCreator'; -type SliceConfig = { +type SliceConfig = { initialValue: Value; singleItem?: { type: SingleItemType; @@ -31,7 +31,7 @@ export function createStoreFactory(configs: T, storeN }, initialValue, !!singleItem, - )(set as any, get as any, api as any), + )(set, get, api), }), {} as State, ); diff --git a/src/store/utils/slice.ts b/src/store/utils/slice.ts index 45dcd3e2..754657dc 100644 --- a/src/store/utils/slice.ts +++ b/src/store/utils/slice.ts @@ -71,9 +71,9 @@ export const createBaseSlice = ( (baseSlice as any)[`add${capitalize(keys.basic)}Item`] = (updatedValue: T) => set( state => { - const value = state[keys.basic] as any; + const value = state[keys.basic]; - return { [keys.basic]: updateValue(value, updatedValue) } as any; + return { [keys.basic]: updateValue(value, updatedValue) } as Partial>; }, false, `add${capitalizedTitle}Item`,