mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-23 03:27:05 -04:00
![renovate[bot]](/assets/img/avatar_default.png)
* Update dependency eslint-plugin-import to v2.25.2 Signed-off-by: Renovate Bot <bot@renovateapp.com> Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Make type imports more explicit Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> * Enforce use of type imports Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de> Co-authored-by: Renovate Bot <bot@renovateapp.com> Co-authored-by: Tilman Vatteroth <git@tilmanvatteroth.de>
35 lines
948 B
TypeScript
35 lines
948 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: 2021 The HedgeDoc developers (see AUTHORS file)
|
|
*
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import type { RendererStatus, RendererStatusActions } from './types'
|
|
import { RendererStatusActionType } from './types'
|
|
import type { Reducer } from 'redux'
|
|
|
|
const initialState: RendererStatus = {
|
|
rendererReady: false
|
|
}
|
|
|
|
/**
|
|
* Applies {@link RendererStatusActions renderer status actions} to the global application state.
|
|
*
|
|
* @param state the current state
|
|
* @param action the action that should get applied
|
|
* @return The new changed state
|
|
*/
|
|
export const RendererStatusReducer: Reducer<RendererStatus, RendererStatusActions> = (
|
|
state: RendererStatus = initialState,
|
|
action: RendererStatusActions
|
|
) => {
|
|
switch (action.type) {
|
|
case RendererStatusActionType.SET_RENDERER_STATUS:
|
|
return {
|
|
...state,
|
|
rendererReady: action.rendererReady
|
|
}
|
|
default:
|
|
return state
|
|
}
|
|
}
|