1
0 Comments

Integrated Typescript into code base

I had been struggling with creating schemas for objects and aligning those objects with the Firebase Firestore fields. Typescript had been on my radar for some time, but I hadn't worked with it before.

I come from a C# background where OOP is king. Moving into Javascript, I wanted to fully embrace the Prototypical Inheritance model rather than using the syntactic sugar of classes. My solution was to use Typescript as a way to simply ensure that customs objects and functions were passed the correct data.

Typescript was really easy to integrate into the project. Vue 3.x is written fully in Typescript so it has excellent support. All I had to do was run vue add typescript and the rest was straightforward. Obviously I had to learn some of the special keywords that Typescript has, but I am quite familiar with the pattern of using Interfaces.

Now my code base is much more scalable and I won't be worrying that I passed the wrong data type into a function. Just like with Javascript, there are good parts and bad parts. The key is to learn the differences and keep moving forward.

Trending on Indie Hackers
Getting first 908 Paid Signups by Spending $353 ONLY. 24 comments I talked to 8 SaaS founders, these are the most common SaaS tools they use 20 comments What are your cold outreach conversion rates? Top 3 Metrics And Benchmarks To Track 19 comments Hero Section Copywriting Framework that Converts 3x 12 comments Join our AI video tool demo, get a cool video back! 12 comments How I Sourced 60% of Customers From Linkedin, Organically 11 comments