mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
Co-authored-by: Heroman3003 <31296024+Heroman3003@users.noreply.github.com> Co-authored-by: Selis <selis@xynolabs.com>
18 lines
388 B
JavaScript
18 lines
388 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' }),
|
|
};
|
|
};
|