mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-13 03:02:38 +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>
21 lines
520 B
TypeScript
21 lines
520 B
TypeScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import { useDispatch, useSelector } from 'tgui/backend';
|
|
import { updateSettings, toggleSettings } from './actions';
|
|
import { selectSettings } from './selectors';
|
|
|
|
export const useSettings = () => {
|
|
const settings = useSelector(selectSettings);
|
|
const dispatch = useDispatch();
|
|
return {
|
|
...settings,
|
|
visible: settings.view.visible,
|
|
toggle: () => dispatch(toggleSettings()),
|
|
update: (obj) => dispatch(updateSettings(obj)),
|
|
};
|
|
};
|