TutorialsAlpha

Incrementally Adopting Effect

Effect was designed from the start with incremental adoption in mind. You can continue to use your existing code and incorporate Effect as much (or as little) as you prefer, and only where it makes the most sense within your application.

In this way, you can immediately begin to benefit from Effect without needing to make drastic changes to your codebase.

What We'll Be Doing

In this tutorial we will walk through strategies for incrementally adopting Effect into an existing application. Our goal will be to gradually refactor the code within an existing REST API built with Express to use Effect.

In the editor to the right, you will see the following files in the src directory:

  • main.ts: contains the logic for starting our HTTP server and serving requests
  • repo.ts: contains the logic for creating, reading, updating, and deleting (CRUD) todos

How To Use This Tutorial

To the right is an editor and a console window. As you make changes to the code in the editor, the program will re-run and show the output in the console.

Each section will present an exercise designed to illustrate a feature. Later exercises build on the knowledge gained in earlier ones, so it's recommended that you go from start to finish. If necessary, you can navigate via the menu above.

If you want to view the recommended solution to an exercise, click the "Show Solution" button in the upper-right corner of the page.

Next: Getting Started