More redux work
This commit is contained in:
parent
7dddf03e32
commit
657fecdf17
9 changed files with 278 additions and 219 deletions
|
|
@ -1,5 +1,20 @@
|
|||
import '../models/fireMapState.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
FireMapState fireMapReducer(FireMapState state, action) {
|
||||
return state;
|
||||
}
|
||||
import '../models/fireMapState.dart';
|
||||
import 'actions.dart';
|
||||
|
||||
final fireMapReducer = combineReducers<FireMapState>([
|
||||
new TypedReducer<FireMapState, ShowYourLocationMapAction>(
|
||||
_showYourLocationMap),
|
||||
]);
|
||||
|
||||
FireMapState _showYourLocationMap(
|
||||
FireMapState state, ShowYourLocationMapAction action) {
|
||||
if (action.loc.subscribed) {
|
||||
return state.copyWith(
|
||||
status: action.loc.subscribed
|
||||
? FireMapStatus.unsubscribe
|
||||
: FireMapStatus.view,
|
||||
yourLocation: action.loc);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue