mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-11 10:22:13 +00:00
uses the current tgui eslint and upgrades react to 18.2. At least it will stop worrying about the line length
22 lines
540 B
JavaScript
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)),
|
|
};
|
|
};
|