Skip to content

Instantly share code, notes, and snippets.

@viniciusCamargo
Created February 19, 2019 09:27
Show Gist options
  • Save viniciusCamargo/2720072f320bc1f4de09ddf302cdb24e to your computer and use it in GitHub Desktop.
Save viniciusCamargo/2720072f320bc1f4de09ddf302cdb24e to your computer and use it in GitHub Desktop.
ts nice closure pattern
// 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