refs #14615-placeholder-message-displayed-instead-of-inputs-link
[arvados.git] / src / store / properties / properties-reducer.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { PropertiesState, setProperty, deleteProperty } from './properties';
6 import { PropertiesAction, propertiesActions } from './properties-actions';
7
8
9 export const propertiesReducer = (state: PropertiesState = {}, action: PropertiesAction) =>
10     propertiesActions.match(action, {
11         SET_PROPERTY: ({ key, value }) => setProperty(key, value)(state),
12         DELETE_PROPERTY: key => deleteProperty(key)(state),
13         default: () => state,
14     });