projects
/
arvados-workbench2.git
/ blobdiff
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch '14097-make-a-copy-process'
[arvados-workbench2.git]
/
src
/
store
/
dialog
/
dialog-reducer.ts
diff --git
a/src/store/dialog/dialog-reducer.ts
b/src/store/dialog/dialog-reducer.ts
index 34d38fdf4ea6e2d39dc28814a2f2a1dcee5e9733..48f8ee8a1e6caac149fb07b8c94a10a46a3f2377 100644
(file)
--- a/
src/store/dialog/dialog-reducer.ts
+++ b/
src/store/dialog/dialog-reducer.ts
@@
-4,11
+4,11
@@
import { DialogAction, dialogActions } from "./dialog-actions";
import { DialogAction, dialogActions } from "./dialog-actions";
-export type DialogState = Record<string, Dialog>;
+export type DialogState = Record<string, Dialog
<any>
>;
-export interface Dialog {
+export interface Dialog
<T>
{
open: boolean;
open: boolean;
- data:
any
;
+ data:
T
;
}
export const dialogReducer = (state: DialogState = {}, action: DialogAction) =>
}
export const dialogReducer = (state: DialogState = {}, action: DialogAction) =>
@@
-20,3
+20,5
@@
export const dialogReducer = (state: DialogState = {}, action: DialogAction) =>
default: () => state,
});
default: () => state,
});
+export const getDialog = <T>(state: DialogState, id: string) =>
+ state[id] ? state[id] as Dialog<T> : undefined;