Skip to content

Instantly share code, notes, and snippets.

@bradharms
Created May 5, 2020 18:04
Show Gist options
  • Save bradharms/c5185cb65b3057e7ec83798e6deba0e8 to your computer and use it in GitHub Desktop.
Save bradharms/c5185cb65b3057e7ec83798e6deba0e8 to your computer and use it in GitHub Desktop.
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