Created
February 19, 2019 09:27
-
-
Save viniciusCamargo/2720072f320bc1f4de09ddf302cdb24e to your computer and use it in GitHub Desktop.
ts nice closure pattern
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
// response: Response. import 'isomorphic-fetch'; | |
// map: import { map } from 'rxjs/operators'; | |
const bodyMap = <T>() => map<T, FormattedResponse<T>>((body: T) => ({ response, body })); | |
return from(response.arrayBuffer()).pipe(bodyMap<ArrayBuffer>()); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment