Skip to content

Commit

Permalink
types fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
SKarolFolio committed Dec 12, 2024
1 parent 6784f41 commit 56728a8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/store/utils/createStoreFactory.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { createBaseSlice, type SliceState } from './slice';
import { generateStore, type StateCreatorTyped } from './storeCreator';

type SliceConfig<Value = any, SingleItemType = any> = {
type SliceConfig<Value = unknown, SingleItemType = unknown> = {
initialValue: Value;
singleItem?: {
type: SingleItemType;
Expand Down Expand Up @@ -31,7 +31,7 @@ export function createStoreFactory<U, T extends SliceConfigs>(configs: T, storeN
},
initialValue,
!!singleItem,
)(set as any, get as any, api as any),
)(set, get, api),
}),
{} as State,
);
Expand Down
4 changes: 2 additions & 2 deletions src/store/utils/slice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ export const createBaseSlice = <K extends string, V, T = V>(
(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<SliceState<K, V, T>>;
},
false,
`add${capitalizedTitle}Item`,
Expand Down

0 comments on commit 56728a8

Please sign in to comment.