(message)
| 27 | * @param {Object} message - The message to add to the collection. |
| 28 | */ |
| 29 | const addMessage = (message) => { |
| 30 | setMessages((prev) => [...prev, message]); |
| 31 | }; |
| 32 | |
| 33 | /** |
| 34 | * A function for clearing all messages in the collection and resetting to the initial message. |