hedgedoc/src/redux/api-url/methods.ts
Tilman Vatteroth 6a43d0c5fb Reorganize redux types to avoid unnecessary type casting
Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
2021-07-26 21:53:08 +02:00

15 lines
383 B
TypeScript

/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { store } from '..'
import { ApiUrlActionType, ApiUrlObject, SetApiUrlAction } from './types'
export const setApiUrl = (state: ApiUrlObject): void => {
store.dispatch({
type: ApiUrlActionType.SET_API_URL,
state
} as SetApiUrlAction)
}