store: use return type over a type cast

This commit is contained in:
Reto Brunner 2023-07-31 10:43:37 +02:00
parent 2878f87879
commit c0b38d4762

View File

@ -90,8 +90,7 @@ export type State = {
searchEnabled: boolean; searchEnabled: boolean;
}; };
const state = () => const state = (): State => ({
({
appLoaded: false, appLoaded: false,
activeChannel: undefined, activeChannel: undefined,
currentUserVisibleError: null, currentUserVisibleError: null,
@ -114,7 +113,7 @@ const state = () =>
messageSearchResults: null, messageSearchResults: null,
messageSearchPendingQuery: null, messageSearchPendingQuery: null,
searchEnabled: false, searchEnabled: false,
} as State); });
type Getters = { type Getters = {
findChannelOnCurrentNetwork: (state: State) => (name: string) => ClientChan | undefined; findChannelOnCurrentNetwork: (state: State) => (name: string) => ClientChan | undefined;