pjfanning commented on code in PR #3655: URL: https://github.com/apache/pekko/pull/3655#discussion_r4358369312
########## docs/src/main/paradox/typed/durable-state/persistence.md: ########## @@ -96,6 +96,13 @@ The two most commonly used effects are: * `persist` will persist the latest value of the state. No history of state changes will be stored * `none` no state to be persisted, for example a read-only command +The state is typically an immutable class, with a new instance passed to the `persist` effect. +If using a mutable state class, create a fresh updated instance and pass it to `persist`. Review Comment: nit: creating a fresh instance per update is really immutable-style usage, so stating the rule directly may read more clearly: ```suggestion If using a mutable state class, do not mutate the current state instance in place; pass a new instance to `persist`. ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
