Skip to content

Commit

Permalink
Updating README
Browse files Browse the repository at this point in the history
  • Loading branch information
DennisAlund committed Mar 25, 2024
1 parent d778d1e commit c800e8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ final delta = person.toJsonDelta(); // {"lastName": "Smith", "age": 31}


### Implement in your models

An important note is that you call the `saveJsonDeltaState()` in the model's
constructor to set an initial state to compare against later.
```dart
class Person extends JsonSerializable with JsonDelta {
String firstName;
Expand All @@ -24,6 +25,7 @@ class Person extends JsonSerializable with JsonDelta {
required this.lastName,
required this.age,
}) {
// Save the initial state of your object in the constructor
saveJsonDeltaState();
}
Expand Down

0 comments on commit c800e8a

Please # to comment.