Skip to content

Commit

Permalink
fix: add default store return type
Browse files Browse the repository at this point in the history
  • Loading branch information
itsmadhusudhan committed Mar 2, 2024
1 parent 32ddcbd commit 5d45d17
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const createStore = <T>(initialState: T) => {
type StoreType<T> = ReturnType<typeof createStore<T>>;
type Callback<T, P> = (state: T) => P;

export const useStore = <T, P>(
export const useStore = <T, P = T>(
store: StoreType<T>,
selector: Callback<T, P> = (state) => state as unknown as P
): [P, (...args: Parameters<typeof store.setState>) => void] => {
Expand Down

0 comments on commit 5d45d17

Please sign in to comment.