Back to Browse

Handling Side Effects In Functional Code With Railway-Oriented Programming

9.2K views
Jun 27, 2023
14:50

☄️ Master the Modular Monolith Architecture: https://bit.ly/3SXlzSt 📌 Accelerate your Clean Architecture skills: https://bit.ly/3PupkOJ 🚀 Support me on Patreon to access the source code: https://www.patreon.com/milanjovanovic If you're accustomed to object-oriented code, writing functional code is a significant mindset shift. In purely functional code, there are no side effects. But you need to trigger side effects somehow - like saving something in the database. So where do you place side effects in functional code? I'll show you how to do that while applying railway-oriented programming to write functional code. Join my weekly .NET newsletter: https://www.milanjovanovic.tech Read my Blog here: https://www.milanjovanovic.tech/blog Subscribe for more: https://www.youtube.com/@MilanJovanovicTech Chapters 0:00 Starting with imperative code 0:57 What Railway-oriented programming looks like 1:47 Applying the Result object pattern 3:23 Starting the Railway with a Result 4:24 How to combine multiple results 7:50 Handling side effects with Tap 9:47 Asynchronous side effects 13:45 Comparing the imperative and functional approach

Download

0 formats

No download links available.

Handling Side Effects In Functional Code With Railway-Oriented Programming | NatokHD