Skip to content

Commit

Permalink
Rename useStore
Browse files Browse the repository at this point in the history
  • Loading branch information
arhtudormorar committed Jul 11, 2024
1 parent c196b8c commit e83ccdd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/store/selectors/hooks/useSelector.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { StoreType, useDAppStore } from '../../store';
import { StoreType, useStore } from '../../store';

type ExtractState<S> = S extends { getState: () => infer X } ? X : StoreType;

export const useSelector = <T>(
selector: (state: ExtractState<StoreType>) => T
) => {
return useDAppStore(selector);
return useStore(selector);
};
2 changes: 1 addition & 1 deletion src/store/store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,4 @@ export const store = createStore<StoreType, MutatorsOut>(
)
);

export const useDAppStore = createBoundedUseStore(store);
export const useStore = createBoundedUseStore(store);

0 comments on commit e83ccdd

Please sign in to comment.