File tree Expand file tree Collapse file tree 3 files changed +14
-18
lines changed
public/docs/_examples/heroes-graphql/ts/app Expand file tree Collapse file tree 3 files changed +14
-18
lines changed Original file line number Diff line number Diff line change 1
1
// #docplaster
2
2
// #docregion
3
- // #docregion rxjs-extensions
4
- import './rxjs-extensions' ;
5
- // #enddocregion rxjs-extensions
6
3
7
4
// #docregion v1, v2
8
5
import { NgModule } from '@angular/core' ;
@@ -45,7 +42,7 @@ import { HeroSearchComponent } from './hero-search.component';
45
42
// #docregion search
46
43
declarations : [
47
44
// ...
48
- // #enddocregion apollo-ngmodule
45
+ // #enddocregion apollo-ngmodule
49
46
AppComponent ,
50
47
DashboardComponent ,
51
48
HeroDetailComponent ,
Original file line number Diff line number Diff line change 2
2
// #docregion
3
3
import { Component , OnInit } from '@angular/core' ;
4
4
import { Router } from '@angular/router' ;
5
+
6
+ // #docregion rxjs-imports
7
+ import { Observable } from 'rxjs/Observable' ;
5
8
import { Subject } from 'rxjs/Subject' ;
6
9
10
+ // Observable class extensions
11
+ import 'rxjs/add/observable/of' ;
12
+
13
+ // Observable operators
14
+ import 'rxjs/add/operator/catch' ;
15
+ import 'rxjs/add/operator/debounceTime' ;
16
+ import 'rxjs/add/operator/distinctUntilChanged' ;
17
+ // #enddocregion rxjs-imports
18
+
7
19
import { Hero } from './hero' ;
8
20
9
21
import { Angular2Apollo , ApolloQueryObservable } from 'apollo-angular' ;
@@ -48,7 +60,7 @@ export class HeroSearchComponent implements OnInit {
48
60
` ,
49
61
variables : {
50
62
search : this . searchTerms
51
- . debounceTime ( 300 ) // wait for 300ms pause in events
63
+ . debounceTime ( 300 ) // wait 300ms after each keystroke before considering the term
52
64
. distinctUntilChanged ( ) // ignore if next search term is same as previous
53
65
} ,
54
66
forceFetch : true
Load Diff This file was deleted.
You can’t perform that action at this time.
0 commit comments