July 2018
Beginner
236 pages
5h 34m
English
The visual design for the example already hints at the core state that we need. This includes the firstName, lastName, email, and password fields. We can model these as observable properties of the UserEnrollmentData class.
Additionally, we also need to track the async validation that will happen with email. We do that with the boolean validating property. Any errors that are found during the validation are tracked with errors. Finally, the enrollmentStatus tracks the network operation around enrollment. It is a string-enum that can have one of four values: none, pending, completed, or failed:
class UserEnrollmentData { @observable email = ''; @observable password = ''; @observable firstName = ''; @observable ...
Read now
Unlock full access