mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
TGUI 4.3
This commit is contained in:
committed by
Darlantan
parent
5f76f2e855
commit
331e5230d6
17
tgui/packages/tgui-panel/audio/hooks.js
Normal file
17
tgui/packages/tgui-panel/audio/hooks.js
Normal file
@@ -0,0 +1,17 @@
|
||||
/**
|
||||
* @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' }),
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user