Files
S.P.L.U.R.T-Station-13/tgui/packages/tgui-panel/settings/hooks.js
BongaTheProto 75b5bef768 "Upgrades" tgui eslint
uses the current tgui eslint and upgrades react to 18.2. At least it will stop worrying about the line length
2024-03-13 17:17:40 -05:00

22 lines
540 B
JavaScript

/**
* @file
* @copyright 2020 Aleksej Komarov
* @license MIT
*/
import { useDispatch, useSelector } from 'common/redux';
import { toggleSettings, updateSettings } from './actions';
import { selectSettings } from './selectors';
export const useSettings = context => {
const settings = useSelector(context, selectSettings);
const dispatch = useDispatch(context);
return {
...settings,
visible: settings.view.visible,
toggle: () => dispatch(toggleSettings()),
update: obj => dispatch(updateSettings(obj)),
};
};