Cope with Changing Business Requirements

Learn how to structure our code for changing business requirements.

Overview

Writing a greenfield application in FP is usually the easy part. Once the application is running, it will have to evolve alongside changing business requirements. How will our code cope with change? Let’s try making a few changes and see what happens while taking care not to introduce too many new concepts.

Adding a basic check in the application

First, let’s look at a relatively easy change, an additional check. Because we haven’t run any checks on the country, we’ll add a check through which we’ll refuse users from Germany.

The function type will be similar to that of the other checks. Let’s add one in the domain.ts file.

Get hands-on with 1200+ tech skills courses.