patch method
Partially updates a value for a given route and ID.
- route: The route where the value should be partially updated.
- id: The ID associated with the value.
- updates: A map of updates to be applied to the existing value.
Returns:
trueif the value was partially updated successfully, orfalseif the route, ID, or value type was not suitable.
Implementation
bool patch(String route, TId id, Map<String, dynamic> updates) {
if (_data.containsKey(route) && _data[route]!.containsKey(id)) {
if (_data[route]![id] is Map) {
(_data[route]![id] as Map<String, dynamic>).addAll(updates);
return true;
}
}
return false;
}