More work with redux, and location edit (wip)

This commit is contained in:
vjrj 2018-07-03 13:07:02 +02:00
parent e97a5a1a9f
commit e55edce3d4
17 changed files with 311 additions and 186 deletions

View file

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