@lumina-study/user-settings-redux
Version:
Redux store for Lumina Study user settings with unstorage persistence
47 lines • 1.3 kB
TypeScript
import type { TypedUseSelectorHook } from 'react-redux';
import type { RootState, AppDispatch } from './store';
/**
* Typed version of useDispatch hook for use throughout the app
*
* @example
* ```typescript
* const dispatch = useAppDispatch();
* dispatch(setLanguage('he'));
* ```
*/
export declare const useAppDispatch: () => AppDispatch;
/**
* Typed version of useSelector hook for use throughout the app
*
* @example
* ```typescript
* const language = useAppSelector((state) => state.userSettings.language);
* ```
*/
export declare const useAppSelector: TypedUseSelectorHook<RootState>;
/**
* Custom hook to access user settings from the store
*
* @returns The current user settings state
*
* @example
* ```typescript
* const { language } = useUserSettings();
* ```
*/
export declare function useUserSettings(): import("@lumina-study/user-settings").UserSettings;
/**
* Custom hook to access and update the language setting
*
* @returns A tuple containing the current language and a setter function
*
* @example
* ```typescript
* const [language, setLang] = useLanguage();
*
* // Update language
* setLang('he');
* ```
*/
export declare function useLanguage(): readonly ["en" | "he", (newLanguage: "he" | "en") => void];
//# sourceMappingURL=hooks.d.ts.map