Skip to content

Instantly share code, notes, and snippets.

@joanllenas
Created March 4, 2017 22:08
Show Gist options
  • Save joanllenas/174fc0e220a628db49e676e75f14e276 to your computer and use it in GitHub Desktop.
Save joanllenas/174fc0e220a628db49e676e75f14e276 to your computer and use it in GitHub Desktop.
TS Type Inference 3
export type Url = string;
export interface HttpResponse<T> {
data: T;
}
export type PromisedHttpResponse<T> = Promise<HttpResponse<T>>;
export class HttpService<T> {
save(url: Url, data: T): PromisedHttpResponse<T> {
return Promise.resolve({data});
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment