mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
22 lines
521 B
TypeScript
22 lines
521 B
TypeScript
/**
|
|
* @file
|
|
* @copyright 2020 Aleksej Komarov
|
|
* @license MIT
|
|
*/
|
|
|
|
import { useDispatch, useSelector } from 'tgui/backend';
|
|
|
|
import { toggleSettings, updateSettings } 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)),
|
|
};
|
|
};
|