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

Function getId

message-component/src/Message/useStore.tsx:78–84  ·  view source on GitHub ↗
(messageProps: MessageProps)

Source from the content-addressed store, hash-verified

76
77let count = 1;
78export function getId(messageProps: MessageProps) {
79 if (messageProps.id) {
80 return messageProps.id;
81 }
82 count += 1;
83 return count;
84}
85
86export function getMessagePosition(messageList: MessageList, id: number) {
87 for (const [position, list] of Object.entries(messageList)) {

Callers 1

useStoreFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected