import { createSelector } from '@reduxjs/toolkit' import { initialState } from '.' import { State } from '../types' // First select the relevant part from the state const selectDomain = (state: State) => state.global || initialState export const selectGlobalLoading = createSelector([selectDomain], (global) => global.loading) export const selectExchangeRate = createSelector([selectDomain], (global) => global.exchangeRate)