1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { keepServicesActions, KeepServicesActions } from '~/store/keep-services/keep-services-actions';
6 import { KeepServiceResource } from '~/models/keep-services';
8 export type KeepSericesState = KeepServiceResource[];
10 const initialState: KeepSericesState = [];
12 export const keepServicesReducer = (state: KeepSericesState = initialState, action: KeepServicesActions): KeepSericesState =>
13 keepServicesActions.match(action, {
14 SET_KEEP_SERVICES: items => items,
15 REMOVE_KEEP_SERVICE: (uuid: string) => state.filter((keepService) => keepService.uuid !== uuid),