Extract the render ready status into an extra redux state

Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
Tilman Vatteroth 2021-06-21 15:20:49 +02:00
parent 568393eaab
commit 015a5cf496
10 changed files with 92 additions and 38 deletions

View file

@ -0,0 +1,21 @@
/*
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
*
* SPDX-License-Identifier: AGPL-3.0-only
*/
import { store } from '..'
import { RendererStatusActionType, SetRendererStatusAction } from './types'
/**
* Dispatches a global application state change for the "renderer ready" state.
*
* @param rendererReady The new renderer ready state.
*/
export const setRendererStatus = (rendererReady: boolean): void => {
const action: SetRendererStatusAction = {
type: RendererStatusActionType.SET_RENDERER_STATUS,
rendererReady
}
store.dispatch(action)
}