Create composable helper for setting constant pickerId
authorMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 15 Nov 2018 09:40:58 +0000 (10:40 +0100)
committerMichal Klobukowski <michal.klobukowski@contractors.roche.com>
Thu, 15 Nov 2018 09:40:58 +0000 (10:40 +0100)
Feature #14470

Arvados-DCO-1.1-Signed-off-by: Michal Klobukowski <michal.klobukowski@contractors.roche.com>

src/store/tree-picker/picker-id.tsx [new file with mode: 0644]

diff --git a/src/store/tree-picker/picker-id.tsx b/src/store/tree-picker/picker-id.tsx
new file mode 100644 (file)
index 0000000..5621954
--- /dev/null
@@ -0,0 +1,12 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+import * as React from 'react';
+
+export const pickerId =
+    (id: string) =>
+        <P extends { pickerId: string }>(Component: React.ComponentType<P>) =>
+            (props: P) =>
+                <Component {...props} pickerId={id} />;
+                
\ No newline at end of file