Location edition

This commit is contained in:
vjrj 2018-07-05 12:50:08 +02:00
parent e55edce3d4
commit 87718b7ad5
15 changed files with 138 additions and 75 deletions

View file

@ -8,8 +8,8 @@ final yourLocationsReducer = combineReducers<List<YourLocation>>([
_addedYourLocation),
new TypedReducer<List<YourLocation>, DeletedYourLocationAction>(
_deletedYourLocation),
new TypedReducer<List<YourLocation>, UpdateYourLocationAction>(
_updateYourLocation),
new TypedReducer<List<YourLocation>, UpdatedYourLocationAction>(
_updatedYourLocation),
new TypedReducer<List<YourLocation>, ToggledSubscriptionAction>(
_toggledSubscriptionAction)
]);
@ -26,8 +26,8 @@ List<YourLocation> _deletedYourLocation(
.toList();
}
List<YourLocation> _updateYourLocation(
List<YourLocation> yourLocations, UpdateYourLocationAction action) {
List<YourLocation> _updatedYourLocation(
List<YourLocation> yourLocations, UpdatedYourLocationAction action) {
return yourLocations
.map((yourLocation) =>
yourLocation.id == action.loc.id ? action.loc : yourLocation)