In this article I will show you how to write safer
TypeScript code by leveraging a feature called strictNullChecks. It's quite easy to miss because it's turned off by default, but can help a lot to produce more robust code. I'll also briefly introduce another lesser-known feature of the language called type guards.
Some Java full-stack developers (like me) always wanted to have statically typed
JavaScript. I remember when starting a new project with
GWT and being quite amazed by the possibility of using Java on both sides.
Nowadays, many new languages are trying to be a replacement of JavaScript. TypeScript is one of them. I got my first experience with TypeScript when trying early betas of
Angular 2. I quite liked a concept of adding static types to JavaScript. However, I also see developers trying to keep the freedom of JavaScript. Fortunately, TypeScript gives developers flexibility to decide what way they want to go and how they want to mix static vs dynamic types.
To experiment with these tradeoffs, I decided to use TypeScript for a new
React/
Redux project. The application is a web SPA which is the front end for a typical SAAS. Users can register/login, adding credit cards, managing api keys, see billing information, etc. All the examples in this article will be from that project and have React+Redux context.
06 January, 2017
/