1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: AGPL-3.0
5 import { virtualMachinesActions, VirtualMachineActions } from '~/store/virtual-machines/virtual-machines-actions';
6 import { ListResults } from '~/services/common-service/common-service';
7 import { VirtualMachineLogins } from '~/models/virtual-machines';
9 interface VirtualMachines {
11 virtualMachines: ListResults<any>;
12 logins: VirtualMachineLogins;
13 links: ListResults<any>;
16 const initialState: VirtualMachines = {
38 export const virtualMachinesReducer = (state = initialState, action: VirtualMachineActions): VirtualMachines =>
39 virtualMachinesActions.match(action, {
40 SET_REQUESTED_DATE: date => ({ ...state, date }),
41 SET_VIRTUAL_MACHINES: virtualMachines => ({ ...state, virtualMachines }),
42 SET_LOGINS: logins => ({ ...state, logins }),
43 SET_LINKS: links => ({ ...state, links }),