mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 19:22:20 +00:00
Converts some of tgui-panel to typescript Co-authored-by: Jeremiah <42397676+jlsnow301@users.noreply.github.com> Co-authored-by: Giz <13398309+vinylspiders@users.noreply.github.com>
18 lines
365 B
TypeScript
18 lines
365 B
TypeScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import { useSelector, useDispatch } from 'tgui/backend';
|
|
import { selectAudio } from './selectors';
|
|
|
|
export const useAudio = () => {
|
|
const state = useSelector(selectAudio);
|
|
const dispatch = useDispatch();
|
|
return {
|
|
...state,
|
|
toggle: () => dispatch({ type: 'audio/toggle' }),
|
|
};
|
|
};
|