Merge branch '13797-refatoring-part2'
[arvados-workbench2.git] / src / store / context-menu / context-menu-reducer.ts
index 147f094336526106182c294426597c6a385d2230..b20ad723f23d9aec615ab4700ca48db90be9f840 100644 (file)
@@ -3,7 +3,7 @@
 // SPDX-License-Identifier: AGPL-3.0
 
 import { ResourceKind } from "../../models/resource";
-import actions, { ContextMenuAction } from "./context-menu-actions";
+import { contextMenuActions, ContextMenuAction } from "./context-menu-actions";
 
 export interface ContextMenuState {
     position: ContextMenuPosition;
@@ -24,11 +24,10 @@ const initialState = {
     position: { x: 0, y: 0 }
 };
 
-const reducer = (state: ContextMenuState = initialState, action: ContextMenuAction) =>
-    actions.match(action, {
+export const contextMenuReducer = (state: ContextMenuState = initialState, action: ContextMenuAction) =>
+    contextMenuActions.match(action, {
         default: () => state,
         OPEN_CONTEXT_MENU: ({resource, position}) => ({ resource, position }),
         CLOSE_CONTEXT_MENU: () => ({ position: state.position })
     });
 
-export default reducer;