21700: Install Bundler system-wide in Rails postinst
[arvados.git] / services / workbench2 / src / store / properties / properties.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 export type PropertiesState = { [key: string]: any };
6
7 export const getProperty = <T>(id: string) =>
8     (state: PropertiesState): T | undefined =>
9         state[id];
10
11 export const setProperty = <T>(id: string, data: T) =>
12     (state: PropertiesState) => ({
13         ...state,
14         [id]: data
15     });
16
17 export const deleteProperty = (id: string) =>
18     (state: PropertiesState) => {
19         const newState = { ...state };
20         delete newState[id];
21         return newState;
22     };
23