Make configurable explicit, remove getDataExplorer
[arvados-workbench2.git] / src / store / data-explorer / data-explorer-middleware-service.ts
index 444e74006b8d01cac75e83bec11657850e92b7f0..e47824c17d3a401b55a91a8c7a0be760962e48b4 100644 (file)
@@ -2,21 +2,21 @@
 //
 // SPDX-License-Identifier: AGPL-3.0
 
-import { getDataExplorer } from "./data-explorer-reducer";
-import { MiddlewareAPI } from "../../../node_modules/redux";
+import { Dispatch, MiddlewareAPI } from "redux";
 import { DataColumns } from "../../components/data-table/data-table";
+import { RootState } from "../store";
 
 export abstract class DataExplorerMiddlewareService {
+    protected readonly id: string;
 
-    abstract get Id(): string;
-    abstract get Columns(): DataColumns<any>;
-    abstract requestItems (api: MiddlewareAPI): void;
-    
-    protected api: MiddlewareAPI;
-    set Api(value: MiddlewareAPI) {
-        this.api = value;
+    protected constructor(id: string) {
+        this.id = id;
     }
-    get DataExplorer () {
-        return getDataExplorer(this.api.getState(), this.Id);
+
+    public getId() {
+        return this.id;
     }
-}
\ No newline at end of file
+
+    abstract getColumns(): DataColumns<any>;
+    abstract requestItems(api: MiddlewareAPI<Dispatch, RootState>): void;
+}