Skip to content

Instantly share code, notes, and snippets.

@tjjfvi
Last active March 2, 2020 22:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tjjfvi/93613c050763a48f284d8d0c31f7eeac to your computer and use it in GitHub Desktop.
Save tjjfvi/93613c050763a48f284d8d0c31f7eeac to your computer and use it in GitHub Desktop.
Create a callable class in Flow
const _Name = { Name: class <T> {
val: T;
constructor(val: T){
this.val = val;
}
} }.Name;
const Name = (() => {
declare class Name<T> extends _Name<T> {
(): T
}
return ((_Name: any): typeof Name);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment