That is one lengthy, specific title. Well, that is because what I am about to cover on this post might not work for you if you had some differences in your machine’s setup.
I always setup a new SSH alias when I join a new company. This allows me to easily use a different SSH key for that specific company without having to write a lengthy git command. Now, there are many tutorials on how to access private Go packages, but I only found one that covers the use of SSH alias. …
Let’s kickoff this post with this code snippet.
Both call to
bodyMassIndex will not throw any warning on TypeScript, even though the second call has an overloaded parameter in the key
name. One thing about TypeScript’s typing, it is not that strict.
For example, the contracts, or
interface, in TypeScript can have optional properties. Moreover, its concrete implementation is allowed to have more properties in it than what the
interface defines. Some may say it is the wrong way to do contracts, but for me at least it is better than no contract at all.
Back to the post.
Ever since learning about it, I have always thought that generic type is awesome. But now I know that it can be even more awesome!
With generic, a single type can be reused with a variety of other types. Think of
Promise, it can resolve to just about anything. For example, in one case it would resolve a string, while another case expect it to resolve a boolean. As
Promise type is a generic, we can assert the resolved value by passing the type into its generic, like so
Alright, enough of the basic. What if you…
I am pretty pissed right now as I just spent about one and a half hours hunting down the exact place a value was defined in a Vue 2 app I am maintaining. Needless to say, it was very unpleasant.
I was trying to refactor the code, extracting out a component from a page to be reusable. As I was moving the code around, the console logged an error:
[Vue warn]: Invalid prop: type check failed for prop "myProp". Expected String with value "undefined", got Undefined
The code shows the expected value seems to be coming from a computed value…
I am setting my goals for 2021, many of which are intentionally ambitious to ensure I work my ass off to achieve them.
Form is ubiquitous in apps. So there is a high chance that you will hit this problem in your first encounter with Flutter.
Say you were testing your pixel-perfect designed form on your test device. You hit the input field, the device’s keyboard was brought up and it covered some of your screen’s contents. You saw a little warning about bottom overflow. You checked your terminal and it printed:
Regardless of the warning, your UI seems to still work, kind of. You noticed that scrolling did not work. So, you googled the problem and found an answer on SO.
I was experimenting with a factory that build an instance of a class, which is passed as a parameter of the factory method. However, TypeScript kept throwing an error as I type the parameter with an interface.
The error thrown was “Type ‘Messenger’ has no construct signatures”.