Use bindDataExplorerActions in middleware, remove api field from service class, updat...
[arvados-workbench2.git] / src / store / data-explorer / data-explorer-middleware-service.ts
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: AGPL-3.0
4
5 import { getDataExplorer } from "./data-explorer-reducer";
6 import { MiddlewareAPI } from "redux";
7 import { DataColumns } from "../../components/data-table/data-table";
8
9 export abstract class DataExplorerMiddlewareService {
10     protected readonly id: string;
11
12     protected constructor(id: string) {
13         this.id = id;
14     }
15
16     public getId() {
17         return this.id;
18     }
19
20     abstract getColumns(): DataColumns<any>;
21     abstract requestItems(api: MiddlewareAPI): void;
22
23     getDataExplorer(api: MiddlewareAPI) {
24         return getDataExplorer(api.getState().dataExplorer, this.id);
25     }
26 }