-
-
Save IhsanMujdeci/9732da3c1e816742dc586a8b3ef3c14d to your computer and use it in GitHub Desktop.
User Typed Selector
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {RootType} from "../rootreducer"; | |
import {useSelector} from "react-redux"; | |
export function useTypedSelector<T>( | |
selector: (state: RootType) => T, | |
equalityFn?: (left: T, right: T) => boolean): T { | |
return useSelector<RootType, T>(selector, equalityFn); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Your rootType location and name will differ