Created
May 5, 2020 18:04
-
-
Save bradharms/c5185cb65b3057e7ec83798e6deba0e8 to your computer and use it in GitHub Desktop.
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 getQuizzes from './selectors/getQuizzes'; | |
import setQuizAnswer from './actions/setQuizAnswer'; | |
const useQuizController = () => { | |
const dispatch = useDispatch(); | |
const quizzes = useSelector(g); | |
const setQuizAnswer = useCallback((quiz, answer) => dispatch(setQuizAnswer(quiz, answer)), []); | |
return { | |
setQuizAnswer, | |
quizzes | |
} | |
} | |
export default useQuizController; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment