Page MenuHomePhorge

D11369.1768841062.diff
No OneTemporary

Size
697 B
Referenced Files
None
Subscribers
None

D11369.1768841062.diff

diff --git a/lib/hooks/ops-hooks.js b/lib/hooks/ops-hooks.js
new file mode 100644
--- /dev/null
+++ b/lib/hooks/ops-hooks.js
@@ -0,0 +1,21 @@
+// @flow
+
+import * as React from 'react';
+
+import type { MessageID } from '../types/db-ops-types.js';
+import type { SuperAction } from '../types/redux-types.js';
+import { useDispatch } from '../utils/redux-utils.js';
+
+function useDispatchWithMessageID(): (
+ action: SuperAction,
+ messageID: MessageID,
+) => mixed {
+ const dispatch = useDispatch();
+ return React.useCallback(
+ (action: SuperAction, messageID: MessageID) =>
+ dispatch({ ...action, messageID }),
+ [dispatch],
+ );
+}
+
+export { useDispatchWithMessageID };

File Metadata

Mime Type
text/plain
Expires
Mon, Jan 19, 4:44 PM (2 h, 56 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5957297
Default Alt Text
D11369.1768841062.diff (697 B)

Event Timeline