Skip to content

Commit

Permalink
doc: Adding a tip on how to create the 'copyWith' method for custom c…
Browse files Browse the repository at this point in the history
…lasses
  • Loading branch information
klkucaj committed Dec 5, 2024
1 parent 1b6e270 commit efeeeec
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion docs/06-concepts/03-serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ For most purposes, you will want to use Serverpod's native serialization. Howeve
}
```
3. There must be a method called `copyWith()`, which returns a new instance of the object with the specified fields replaced.
:::tip
In the framework, `copyWith()` is implemented as a deep copy to ensure immutability. We recommend following this approach when implementing it for custom classes to avoid unintentional side effects caused by shared mutable references.
Expand Down

0 comments on commit efeeeec

Please sign in to comment.