Skip to content

Commit 3d9e582

Browse files
Improve readme code snippets
1 parent 1ef305b commit 3d9e582

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

README.rst

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -312,9 +312,8 @@ Get the first page on initial load and store the state (e.g., in memory or a fil
312312
"next_page_cursor": pagination.next_page_cursor,
313313
"has_next_page": pagination.has_next_page,
314314
}
315-
# with open("pagination_state.json", "w") as f:
316-
# with open("/tmp/seam_connected_accounts_list.json", "w") as f:
317-
# json.dump(pagination_state, f)
315+
with open("/tmp/seam_connected_accounts_list.json", "w") as f:
316+
json.dump(pagination_state, f)
318317
319318
Get the next page at a later time using the stored state:
320319

@@ -326,15 +325,8 @@ Get the next page at a later time using the stored state:
326325
seam = Seam()
327326
328327
# Example: Load state from where it was stored
329-
# with open("/tmp/seam_connected_accounts_list.json", "r") as f:
330-
# pagination_state = json.load(f)
331-
# Placeholder for loaded state:
332-
pagination_state = {
333-
"params": {"limit": 20},
334-
"next_page_cursor": "some_cursor_value",
335-
"has_next_page": True,
336-
}
337-
328+
with open("/tmp/seam_connected_accounts_list.json", "r") as f:
329+
pagination_state = json.load(f)
338330
339331
if pagination_state.get("has_next_page"):
340332
paginator = seam.create_paginator(

0 commit comments

Comments
 (0)