The article below was posted on Dev.to
Ever since I started using Firestore more than 7 years ago, I have been wanting to find a better way to type my code and reduce boilerplate. In this article I will explain how I finally found a way to write clean, strongly-typed code with abstractions that are easy to use and adopt in any Typescript project.
By defining typed reusable references for all database collections, we can let other functions infer their types from them, sparing us from having to import and apply types all over the place.