(partial: Partial<ChatLikeState> | ((s: ChatLikeState) => Partial<ChatLikeState>))
| 201 | }; |
| 202 | |
| 203 | const set = (partial: Partial<ChatLikeState> | ((s: ChatLikeState) => Partial<ChatLikeState>)) => { |
| 204 | const patch = typeof partial === 'function' ? partial(state) : partial; |
| 205 | state = { ...state, ...patch }; |
| 206 | }; |
| 207 | const get = () => state; |
| 208 | return { set, get, read: () => state }; |
| 209 | } |
no outgoing calls
no test coverage detected