Skip to content

Commit

Permalink
Expose ES observables instead of RxJS observables
Browse files Browse the repository at this point in the history
  • Loading branch information
kimjoar committed Nov 2, 2017
1 parent 68c12fa commit a0ef568
Show file tree
Hide file tree
Showing 97 changed files with 5,103 additions and 831 deletions.
3 changes: 2 additions & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
packages/kbn-types/types/
packages/kbn-types/types
packages/**/target
core_plugins/**/target
10 changes: 5 additions & 5 deletions example_plugins/baz/src/BazService.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Observable } from 'rxjs';
import { k$, Observable, $combineLatest, map, first, toPromise } from 'kbn-observable';

import { ElasticsearchService, KibanaConfig, KibanaRequest } from 'kbn-types';

Expand All @@ -13,7 +13,7 @@ export class BazService {
const { page = 1, perPage = 20, type } = options;

const [kibanaIndex, adminCluster] = await latestValues(
this.kibanaConfig$.map(config => config.index),
k$(this.kibanaConfig$)(map(config => config.index)),
this.elasticsearchService.getClusterOfType$('admin')
);

Expand Down Expand Up @@ -64,7 +64,7 @@ function latestValues<A, B, C, D>(
d: Observable<D>
): Promise<[A, B, C, D]>;
function latestValues(...values: Observable<any>[]) {
return Observable.combineLatest(values)
.first()
.toPromise();
return k$($combineLatest(values))(
first(),
toPromise());
}
Loading

0 comments on commit a0ef568

Please sign in to comment.