Created
March 4, 2017 22:08
-
-
Save joanllenas/174fc0e220a628db49e676e75f14e276 to your computer and use it in GitHub Desktop.
TS Type Inference 3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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