Skip to content

Instantly share code, notes, and snippets.

Avatar

patrick-entinux

View GitHub Profile
@patrick-entinux
patrick-entinux / elastic-rx.ts
Last active May 9, 2019
ElasticRx (RxJS Observables for @elastic/elasticsearch)
View elastic-rx.ts
import { ApiResponse } from '@elastic/elasticsearch';
import {
TransportRequestCallback,
TransportRequestOptions,
} from '@elastic/elasticsearch/lib/Transport';
import { Observable } from 'rxjs';
/**
* Use ElasticSearch API with RxJS observables that can be
* cancelled. Observables are cold -- they must be subscribed to make