Easy question for someone to answer, what happens in this typescript function?
getTweetCount = () => this.data.totalCount;
data.totalCount is of type number from a service.
Easy question for someone to answer, what happens in this typescript function?
getTweetCount = () => this.data.totalCount;
data.totalCount is of type number from a service.
getTweetCount = () => this.data.totalCount;
You are creating an "arrow function" that returns this.data.totalCount
. There are lots of docs about arrow functions out there.
Arrow functions are also covered here : https://basarat.gitbooks.io/typescript/content/docs/arrow-functions.html