More redux work. User creation/retrieve
This commit is contained in:
parent
2c67b68512
commit
2dfa745c6a
16 changed files with 212 additions and 110 deletions
9
lib/redux/userReducer.dart
Normal file
9
lib/redux/userReducer.dart
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
import 'actions.dart';
|
||||
import '../models/user.dart';
|
||||
|
||||
User userReducer(User user, action) {
|
||||
if (action is OnUserCreatedAction) return user.copyWith(userId: action.userId);
|
||||
if (action is OnUserTokenAction) return user.copyWith(token: action.token);
|
||||
if (action is OnUserLangAction) return user.copyWith(lang: action.lang);
|
||||
return user;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue