mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
18 lines
386 B
JavaScript
18 lines
386 B
JavaScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import { useSelector, useDispatch } from 'common/redux';
|
|
import { selectAudio } from './selectors';
|
|
|
|
export const useAudio = context => {
|
|
const state = useSelector(context, selectAudio);
|
|
const dispatch = useDispatch(context);
|
|
return {
|
|
...state,
|
|
toggle: () => dispatch({ type: 'audio/toggle' }),
|
|
};
|
|
};
|