Skip to content

Alakazam03/typescript-basics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Typescript Basics

TypeScript Interfaces

  • Interfaces, on TypeScript, exist to perform type checking during compile time. That is, using an interface makes the TypeScript compiler check if variables fill the contract (have the structure) defined by the interface.
  • As occurs in other programming languages, TypeScript does not require an object to have the exact same structure as defined by the interface. To be considered valid, objects can have any shape as long as they define the functions and properties required by the interface that they implement.

TypeScript Decorators

  • Decorators offer a declarative syntax to modify the shape of classes and properties declarations. we will be able to develop elegant solutions to cross-cutting concerns like logging and transactions.
  • Decorators, in the end, are just function wrappers. That is, to create a decorator, we create a function that wraps the call to the original function and changes its behavior in any way we like.

links

  1. Tutorial: https://auth0.com/blog/typescript-practical-introduction/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published