Validating a form using Combine
Sometimes, the reactive way of thinking feels academic and not connected to the usual problems a developer has to solve. In reality, most of the programs we usually write would benefit from using reactive programming, but some problems fit better than others.
As an example, let's consider a part of an app where the user has to fill in a form. The form has several fields, each one with a different way of being validated; some can be validated on their own while others have validation that depends on different fields, and all together concur to validate the whole form.
Imperatively, this usually creates a mess of spaghetti code, but by switching to the reactive declarative way, the code becomes natural.
In this recipe, we'll implement a simple signup page with a username text field and two password fields, one for the password and the other for password confirmation.
The username has a minimum number of characters, and the password...