@selfcommunity/react-core
Version:
React Core Components useful for integrating UI Community components (react-ui).
23 lines (21 loc) • 616 B
TypeScript
import { SCUserSettingsType, SCUserType } from '@selfcommunity/types';
/**
:::info
This custom hook is used to manage user settings.
:::
:::tip How to use it:
Follow these steps:
```jsx
1. const scUserContext: SCUserContextType = useSCUser();
2. const scSettingsManager: SCSettingsManagerType = scUserContext.manager.settings;
3. scSettingsManager.all()
```
:::
*/
export default function useSCSettingsManager(user?: SCUserType): {
update: (p: string, v: any) => Promise<any>;
get: (p: string) => any;
all: () => SCUserSettingsType;
isLoading: () => boolean;
refresh: () => void;
};