( attribution: AttributionState, saveSnapshot: (snapshot: AttributionSnapshotMessage) => void, )
| 948 | * @returns New attribution state with incremented promptCount |
| 949 | */ |
| 950 | export function incrementPromptCount( |
| 951 | attribution: AttributionState, |
| 952 | saveSnapshot: (snapshot: AttributionSnapshotMessage) => void, |
| 953 | ): AttributionState { |
| 954 | const newAttribution = { |
| 955 | ...attribution, |
| 956 | promptCount: attribution.promptCount + 1, |
| 957 | } |
| 958 | const snapshot = stateToSnapshotMessage(newAttribution, randomUUID()) |
| 959 | saveSnapshot(snapshot) |
| 960 | return newAttribution |
| 961 | } |
no test coverage detected