Add presentation layer for mailbox, mail, message

This commit is contained in:
dab246
2021-07-29 12:49:17 +07:00
committed by Dat H. Pham
parent 5d3d2f4c1e
commit 7a99fd2c59
31 changed files with 626 additions and 105 deletions
+8
View File
@@ -13,6 +13,14 @@ abstract class BaseController extends GetxController {
);
}
void getState(Future<Either<Failure, Success>> newStateStream) async {
final state = await newStateStream;
state.fold(
(failure) => onError(failure),
(success) => onData(state)
);
}
void onData(Either<Failure, Success> newState) {
viewState.value = newState;
}