save method
Adds or updates the model
at a given key
in the Source.
Implementation
@override
Future<Change<Record>?> save(
String key,
Record record, {
bool force = false,
}) async {
var existing = map[key];
if (existing == record) {
if (!force) {
return null;
}
}
map[key] = record;
if (existing == null) {
return Added(key, record);
}
return Updated(key, record);
}