Skip to content

Commit

Permalink
docs: add example for checkpoint and rewind
Browse files Browse the repository at this point in the history
  • Loading branch information
KnorpelSenf committed Nov 9, 2024
1 parent f23a9c4 commit a345ecf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/conversation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -336,6 +336,13 @@ First return your data from `external` and then resume update handling using `wa
*
* This checkpoint can be passed to `rewind` in order to go back in the
* conversation and resume it from an earlier point.
*
* ```ts
* const check = conversation.checkpoint();
*
* // Later:
* await conversation.rewind(check);
* ```
*/
checkpoint(): Checkpoint {
return this.controls.checkpoint();
Expand All @@ -345,6 +352,13 @@ First return your data from `external` and then resume update handling using `wa
* there. This point is specified by a checkpoint that can be created by
* calling {@link Conversation.checkpoint}.
*
* ```ts
* const check = conversation.checkpoint();
*
* // Later:
* await conversation.rewind(check);
* ```
*
* @param checkpoint A previously created checkpoint
*/
async rewind(checkpoint: Checkpoint): Promise<never> {
Expand Down

0 comments on commit a345ecf

Please sign in to comment.