(updater: (prev: FileHistoryState) => FileHistoryState)
| 2472 | messages, |
| 2473 | setMessages, |
| 2474 | updateFileHistoryState(updater: (prev: FileHistoryState) => FileHistoryState) { |
| 2475 | // Perf: skip the setState when the updater returns the same reference |
| 2476 | // (e.g. fileHistoryTrackEdit returns `state` when the file is already |
| 2477 | // tracked). Otherwise every no-op call would notify all store listeners. |
| 2478 | setAppState(prev => { |
| 2479 | const updated = updater(prev.fileHistory); |
| 2480 | if (updated === prev.fileHistory) return prev; |
| 2481 | return { |
| 2482 | ...prev, |
| 2483 | fileHistory: updated |
| 2484 | }; |
| 2485 | }); |
| 2486 | }, |
| 2487 | updateAttributionState(updater: (prev: AttributionState) => AttributionState) { |
| 2488 | setAppState(prev => { |
| 2489 | const updated = updater(prev.attribution); |
no outgoing calls
no test coverage detected