Skip to content

Instantly share code, notes, and snippets.

View nikosolihin's full-sized avatar

Niko Solihin nikosolihin

  • Grand Rapids, MI
View GitHub Profile
@nikosolihin
nikosolihin / typescript-assets.ts
Created November 19, 2020 03:22 — forked from loilo/typescript-assets.ts
Some types I found useful during some tricky TypeScript programming
/*
* These are some types I found useful during some tricky TypeScript programming.
* Many of them are not too common or intuitive to come up with, this is why I'm writing them down here for future lookup.
*
* Note: Be careful when copy-pasting, some of these types depend on others.
*/
/**
* Various utilities for working with classes
@nikosolihin
nikosolihin / gist.ts
Created November 19, 2020 03:23 — forked from mattpocock/gist.ts
const endpointToPromiseMap = {
[ApiEndpoint.FetchAllGoals]: fetchUserGoals,
[ApiEndpoint.CurrentUser]: currentUser,
};
type PromiseValue<T extends Promise<any>> = T extends Promise<infer U>
? U
: never;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
@nikosolihin
nikosolihin / string-utils.js
Created June 17, 2021 16:15 — forked from jonlabelle/string-utils.js
Useful collection of JavaScript string utilities.
// String utils
//
// resources:
// -- mout, https://github.com/mout/mout/tree/master/src/string
/**
* "Safer" String.toLowerCase()
*/
function lowerCase(str) {
return str.toLowerCase();

Using JSDOC-Based TypeScript

Get Started

Choose your editor

  • WebStorm, Rider
    • Partial support, not enough intelli hints
    • Toggle on TypeScript language service
  • VSCode