Skip to content

Instantly share code, notes, and snippets.

@babakness
Created October 14, 2018 06:12
Show Gist options
  • Save babakness/6f1d16ebee1e91c8eee1c63a01816352 to your computer and use it in GitHub Desktop.
Save babakness/6f1d16ebee1e91c8eee1c63a01816352 to your computer and use it in GitHub Desktop.
staticImmutableExample.ts
type ReadonlyObj<T> = { readonly [K in string]: T }
const foo: ReadonlyArray<T> = [1,2,3]
const bar: ReadonlyObj = { a: 1, b: 2, c: 3 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment