This actually takes the diff out of a commit and just stamps it to another branch without any regard to whether or not it makes sense or if the larger spots in code where code is being replaced are really still in the same places.
Monday, December 3, 2018
There was a performance problem with Ruby at the Ruby runtime.
This is one of the reasons you don't hear about this stuff anymore. It was the future like Silverlight was the future.
Sunday, December 2, 2018
optional properties at an interface in TypeScript
Use a question mark immediately after the name like so:
interface Cat {
Name: string;
Lives: number;
Birthday?: Date;
}
let cat: Cat = <Cat>{
Name: "Frank",
Lives: 9
}
alert(cat.Name);
You make an "optional" property at a class in the same way.
Saturday, December 1, 2018
The export keyword in TypeScript compiles to JavaScript that loops in the AMD pattern.
There it is again under the hood. That is how that magic works.
It is possible to use Angular 2 and up with just JavaScript and no TypeScript.
I don't know how to do this and I don't want to think about it. It is also possible to run TypeScript at the browser (Internet Explorer) without compiling it down to JavaScript and I don't recommend that either.
Don't new up classes like interfaces in TypeScript.
Which is better?
Well, if you cast JSON to a class as you might an interface (as shown here) you will sidestep the constructor which isn't cool. I hate it that I cannot make a new class in TypeScript as I can in C# by just breaking into curly braces and assigning all properties upon a new up. I hate it that I have to assign all of the properties in a onesies and twosies manner. Yet, that is the way to go. Rats!
let cat = new Cat(); cat.Name = "Frank"; cat.Lives = 9; |
let cat:Cat = <Cat>{ Name: "Frank", Lives: 9 }; |
GDE stands for Google Developer Expert
...Google's version of Microsoft's MVP (Most Valuable Professional)
Subscribe to:
Posts (Atom)