55 ms·
I started one side project like this recently and it's been great so far.
by Tade0 3y ago
I started one side project like this recently and it's been great so far.
- fenomas 3y agoThere's a few clunky bits but I hardly ever run into them. Actually since this conversation is going, here's something I just learned this week that somebody might find helpful. I used to consider enums one of the clunky bits, but I just ran across the `keyof` operator: var modeNames = { FOO: 1, BAR: 2 } /** @param {keyof modeNames} mode */ export function doThing(mode) { // the jsdoc type above is equivalent to {'FOO'|'BAR'} } Probably old hat to TS people, but since I came at it from the other direction (I'd been using JSDoc for traditional doc-creation reasons before I realized VSCode could use it for linting and type hints) it was news to me.
- Tade0 3y agoThat is indeed a neat trick!