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