More redux work
This commit is contained in:
parent
69428c5d96
commit
5d947f9577
14 changed files with 170 additions and 88 deletions
|
|
@ -1,4 +1,4 @@
|
|||
import '../models/yourLocation.dart';
|
||||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
|
||||
abstract class AppActions {}
|
||||
|
||||
|
|
@ -32,4 +32,4 @@ class OnUserLangAction extends AppActions {
|
|||
final String lang;
|
||||
|
||||
OnUserLangAction(this.lang);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -3,7 +3,9 @@ import 'package:redux/redux.dart';
|
|||
import '../globals.dart' as globals;
|
||||
import '../models/appState.dart';
|
||||
import '../models/firesApi.dart';
|
||||
import '../models/yourLocation.dart';
|
||||
|
||||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
|
||||
import '../models/yourLocationPersist.dart';
|
||||
import 'actions.dart';
|
||||
|
||||
|
|
|
|||
|
|
@ -1,3 +1,6 @@
|
|||
import 'actions.dart';
|
||||
|
||||
bool loadedReducer(isLoaded, action) {
|
||||
if (action is FetchYourLocationsSucceededAction) return true;
|
||||
return isLoaded;
|
||||
}
|
||||
|
|
@ -1,3 +1,5 @@
|
|||
import 'actions.dart';
|
||||
bool loadingReducer(isLoading, action) {
|
||||
if (action is FetchYourLocationsAction) return true;
|
||||
return isLoading;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
import 'package:bson_objectid/bson_objectid.dart';
|
||||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
|
||||
|
||||
import '../models/yourLocation.dart';
|
||||
|
||||
abstract class YourLocationActions {}
|
||||
|
||||
|
|
@ -12,6 +13,7 @@ class AddYourLocationAction extends YourLocationActions {
|
|||
|
||||
class DeleteYourLocationAction extends YourLocationActions {
|
||||
ObjectId id;
|
||||
|
||||
DeleteYourLocationAction(this.id);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import 'package:fires_flutter/models/yourLocation.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
import '../models/yourLocation.dart';
|
||||
import 'actions.dart';
|
||||
|
||||
final yourLocationsReducer = combineReducers<List<YourLocation>>([
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue