Skip to content

Instantly share code, notes, and snippets.

View patrick-entinux's full-sized avatar

patrick-entinux

View GitHub Profile
@patrick-entinux
patrick-entinux / elastic-rx.ts
Last active May 9, 2019 03:38
ElasticRx (RxJS Observables for @elastic/elasticsearch)
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