| 1234567891011121314151617181920 |
- import type { RootState } from "@/store/store";
- // 为了解决在组件中获取值时typescript提示可能为null的情况
- export function selectCurrentCurrency(
- state: RootState
- ) {
- const currency = state.currentConfig.currentCurrency;
- if (!currency) {
- throw new Error(
- "currentCurrency is not initialized"
- );
- }
- return currency;
- }
|