MCPcopy Create free account
hub / github.com/QuarkGluonPlasma/react-course-code / findMessage

Function findMessage

guang-components/src/Message/useStore.tsx:94–103  ·  view source on GitHub ↗
(messageList: MessageList, id: number)

Source from the content-addressed store, hash-verified

92}
93
94export function findMessage(messageList: MessageList, id: number) {
95 const position = getMessagePosition(messageList, id);
96
97 const index = position ? messageList[position].findIndex((message) => message.id === id) : -1;
98
99 return {
100 position,
101 index,
102 };
103}
104
105export default useStore;

Callers 1

useStoreFunction · 0.70

Calls 1

getMessagePositionFunction · 0.70

Tested by

no test coverage detected