Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose Sink type from relay-runtime (#4516)
Summary: I want to suggest exporting `Sink` & `Source` types so they can be used to type the argument of `Observable.create`, e.g. something like this: ```js import { Observable } from 'relay-runtime'; const responseHandler = () => {} // Here I would like to use either Source or Sink types export const createRequestHandler = (customFetcher: Fetcher) => (request: RequestParameters, variables: Variables, cacheConfig: CacheConfig) => { const observable = Observable.create(sink => { void customFetcher(request, variables, cacheConfig) .then(responseHandler(sink)) .catch((error: Error) => { sink.error(error); }) .then(() => { sink.complete(); }); }); return observable; }; ``` Pull Request resolved: #4516 Reviewed By: captbaritone Differential Revision: D51027312 Pulled By: alunyov fbshipit-source-id: 9f2cff94e70c436acc9c8498ec890293584dc36b
- Loading branch information