With the emergence and wide adoption of libraries such as React or XState, in the last few years the frontend ecosystem has shifted from an imperative to a declarative programming model. Now that we have realized how much easier it is to reason about declarative code and how many bugs are ruled out by embracing this paradigm, there is simply no going back.
Yet, Javascript and TypeScript weren’t designed for this paradigm, and these languages are lacking a very important piece of the puzzle: declarative code branching.
This talk will demonstrate how we can write conditional logic that is easy to read and maintain using ts-pattern, a Pattern Matching library for TypeScript.
Chapitres:
0:00 Introduction
1:54 Code déclaratif
12:52 Pattern matching
15:26 ts-pattern
19:25 Live coding
31:21 Conclusion
32:25 Questions
Ещё видео!