(messageList: MessageList, id: number)
| 92 | } |
| 93 | |
| 94 | export 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 | |
| 105 | export default useStore; |
no test coverage detected