
import 'package:redux/redux.dart';
import 'package:meta/meta.dart';
import 'package:redux_thunk/redux_thunk.dart';
import 'package:satu/core/redux/state/nav_state.dart';

import '../store.dart';

@immutable
class SetNavStateAction {
  final NavState navState;
  SetNavStateAction(this.navState);
}

ThunkAction<AppState> navigateDrawer(Type viewClass) {
  return (Store<AppState> store) async {
    store.dispatch(SetNavStateAction(NavState(drawerViewClass: viewClass)));
  };
}

ThunkAction<AppState> navigateTab(int index) {
  return (Store<AppState> store) async {
    store.dispatch(SetNavStateAction(NavState(selectedTabIndex: index)));
  };
}
