MCPcopy Create free account
hub / github.com/CommE2E/comm / useResolvedOptionalThreadInfo

Function useResolvedOptionalThreadInfo

lib/utils/entity-helpers.js:117–129  ·  view source on GitHub ↗
(
  threadInfo: ?ThreadInfo,
)

Source from the content-addressed store, hash-verified

115}
116
117function useResolvedOptionalThreadInfo(
118 threadInfo: ?ThreadInfo,
119): ?ResolvedThreadInfo {
120 const resolutionInput = React.useMemo(
121 () => (threadInfo ? [threadInfo] : []),
122 [threadInfo],
123 );
124 const [resolvedThreadInfo] = useResolvedThreadInfos(resolutionInput);
125 if (!threadInfo) {
126 return threadInfo;
127 }
128 return resolvedThreadInfo;
129}
130
131export {
132 useResolvedThreadInfos,

Callers 2

Calls 1

useResolvedThreadInfosFunction · 0.85

Tested by

no test coverage detected