Skip to content

Commit c9753ae

Browse files
committed
docs: update state persistence section to clarify usage of Actor.useState method
1 parent db97f61 commit c9753ae

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

sources/platform/actors/development/builds_and_runs/state_persistence.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ By default, an Actor keeps its state in the server's memory. During a server swi
4747

4848
## Implementing state persistence
4949

50-
The [Apify SDKs](/sdk) handle state persistence automatically.
50+
The simplest way to handle state persistence is with the [`Actor.useState`](/sdk/js/reference/class/Actor#useState) method, which automatically saves and retrieves your state during migrations.
5151

52-
This is done using the `Actor.on()` method and the `migrating` event.
52+
For more control or when using Python, you can manually handle state persistence using the `Actor.on()` method and the `migrating` event.
5353

5454
- The `migrating` event is triggered just before a migration occurs, allowing you to save your state.
5555
- To retrieve previously saved state, you can use the [`Actor.getValue`](/sdk/js/reference/class/Actor#getValue)/[`Actor.get_value`](/sdk/python/reference/class/Actor#get_value) methods.

0 commit comments

Comments
 (0)