(updater: (prev: FileHistoryState) => FileHistoryState)
| 2442 | messages, |
| 2443 | setMessages, |
| 2444 | updateFileHistoryState(updater: (prev: FileHistoryState) => FileHistoryState) { |
| 2445 | // Perf: skip the setState when the updater returns the same reference |
| 2446 | // (e.g. fileHistoryTrackEdit returns `state` when the file is already |
| 2447 | // tracked). Otherwise every no-op call would notify all store listeners. |
| 2448 | setAppState(prev => { |
| 2449 | const updated = updater(prev.fileHistory); |
| 2450 | if (updated === prev.fileHistory) return prev; |
| 2451 | return { |
| 2452 | ...prev, |
| 2453 | fileHistory: updated |
| 2454 | }; |
| 2455 | }); |
| 2456 | }, |
| 2457 | updateAttributionState(updater: (prev: AttributionState) => AttributionState) { |
| 2458 | setAppState(prev => { |
| 2459 | const updated = updater(prev.attribution); |
no outgoing calls
no test coverage detected