More work with redux, and location edit (wip)
This commit is contained in:
parent
e97a5a1a9f
commit
e55edce3d4
17 changed files with 311 additions and 186 deletions
|
|
@ -1,16 +1,30 @@
|
|||
import 'package:redux/redux.dart';
|
||||
import 'package:redux_logging/redux_logging.dart';
|
||||
|
||||
import 'globals.dart' as globals;
|
||||
import 'mainCommon.dart';
|
||||
import 'package:redux/redux.dart';
|
||||
|
||||
enum LogLevel { none, actions, full }
|
||||
|
||||
void main() {
|
||||
globals.isDevelopment = true;
|
||||
var logRedux = false;
|
||||
|
||||
List<Middleware> devMiddlewares = logRedux ? [
|
||||
LoggingMiddleware.printer(formatter: LoggingMiddleware.multiLineFormatter)
|
||||
] : [];
|
||||
String onlyLogActionFormatter<State>(
|
||||
State state,
|
||||
dynamic action,
|
||||
DateTime timestamp,
|
||||
) {
|
||||
return "${action.toString().replaceAll('Instance of ', '')}";
|
||||
}
|
||||
|
||||
LogLevel logRedux = LogLevel.actions;
|
||||
|
||||
List<Middleware> devMiddlewares = logRedux == LogLevel.none
|
||||
? []
|
||||
: [LoggingMiddleware.printer(
|
||||
formatter: logRedux == LogLevel.full
|
||||
? LoggingMiddleware.multiLineFormatter
|
||||
: onlyLogActionFormatter)];
|
||||
|
||||
mainCommon(devMiddlewares);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue