mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 21:30:31 +00:00
re-structure to monorepo.
This commit is contained in:
22
packages/webapp/src/hooks/state/settings.tsx
Normal file
22
packages/webapp/src/hooks/state/settings.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
// @ts-nocheck
|
||||
import { useCallback } from 'react';
|
||||
import { useDispatch, useSelector } from 'react-redux';
|
||||
import { setSettings } from '@/store/settings/settings.actions';
|
||||
|
||||
export const useSetSettings = () => {
|
||||
const dispatch = useDispatch();
|
||||
|
||||
return useCallback(
|
||||
(settings) => {
|
||||
dispatch(setSettings(settings));
|
||||
},
|
||||
[dispatch],
|
||||
);
|
||||
};
|
||||
|
||||
/**
|
||||
* Retrieve the authentication token.
|
||||
*/
|
||||
export const useSettingsSelector = () => {
|
||||
return useSelector((state) => state.settings.data);
|
||||
};
|
||||
Reference in New Issue
Block a user