Skip to content

Instantly share code, notes, and snippets.

@nicojs
Created January 15, 2019 14:45
Show Gist options
  • Save nicojs/586b057ac2789c07d7c79ae6a3936e3e to your computer and use it in GitHub Desktop.
Save nicojs/586b057ac2789c07d7c79ae6a3936e3e to your computer and use it in GitHub Desktop.
class Injector {
injectClass<Tokens extends (keyof Context)[]>(Injectable: Injectable<Tokens, R>): R {
const args = /* resolve inject tokens */;
return new Injectable(...args);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment