Restaurants and sequenceS

Learn how we can make reservations for a hotel and a restaurant at the same time.

Overview

Now, consider another scenario. When someone makes a reservation for a hotel, they can also make a reservation for a restaurant at the same time. When we call our Retrieve Lambda, we expect to get back both the hotel and optionally the restaurant. Yes, this is another scenario that merely serves as an excuse to show something from fp-ts.

In that case, we’d have to change our Retrieve to get both items, preferably in parallel. We’ll assume that our type for a restaurant reservation looks like this:

Get hands-on with 1400+ tech skills courses.