Skip to content
Permalink
Browse files

feat(core): upgrade rxjs to 6.0.0-alpha.4 (#22573)

PR Close #22573
  • Loading branch information...
IgorMinar committed Feb 27, 2018
1 parent c445314 commit b43f8bc7d3d101af3fcf02180c54007bb1e8c4ca
Showing with 10,104 additions and 1,860 deletions.
  1. +1 −1 aio/content/examples/component-interaction/src/app/astronaut.component.ts
  2. +1 −1 aio/content/examples/component-interaction/src/app/mission.service.ts
  3. +1 −1 aio/content/examples/hierarchical-dependency-injection/src/app/heroes-list.component.ts
  4. +1 −2 aio/content/examples/hierarchical-dependency-injection/src/app/heroes.service.ts
  5. +1 −1 aio/content/examples/hierarchical-dependency-injection/src/app/villains-list.component.ts
  6. +1 −1 aio/content/examples/hierarchical-dependency-injection/src/app/villains.service.ts
  7. +3 −3 aio/content/examples/http/src/app/config/config.component.ts
  8. +3 −4 aio/content/examples/http/src/app/config/config.service.ts
  9. +1 −2 aio/content/examples/http/src/app/heroes/heroes.service.ts
  10. +1 −2 aio/content/examples/http/src/app/http-error-handler.service.ts
  11. +0 −2 aio/content/examples/http/src/app/http-interceptors/auth-interceptor.ts
  12. +1 −2 aio/content/examples/http/src/app/http-interceptors/caching-interceptor.ts
  13. +1 −1 aio/content/examples/http/src/app/http-interceptors/ensure-https-interceptor.ts
  14. +0 −1 aio/content/examples/http/src/app/http-interceptors/logging-interceptor.ts
  15. +1 −1 aio/content/examples/http/src/app/http-interceptors/noop-interceptor.ts
  16. +1 −1 aio/content/examples/http/src/app/http-interceptors/trim-name-interceptor.ts
  17. +1 −2 aio/content/examples/http/src/app/http-interceptors/upload-interceptor.ts
  18. +1 −2 aio/content/examples/http/src/app/package-search/package-search.component.ts
  19. +1 −2 aio/content/examples/http/src/app/package-search/package-search.service.ts
  20. +1 −1 aio/content/examples/http/src/app/uploader/uploader.service.ts
  21. +1 −2 aio/content/examples/ngmodule-faq/src/app/contact/contact.service.ts
  22. +1 −1 aio/content/examples/ngmodule-faq/src/app/crisis/crisis-list.component.ts
  23. +1 −2 aio/content/examples/ngmodule-faq/src/app/crisis/crisis.service.ts
  24. +1 −1 aio/content/examples/ngmodule-faq/src/app/hero/hero-list.component.ts
  25. +1 −2 aio/content/examples/ngmodule-faq/src/app/hero/hero.service.ts
  26. +4 −5 aio/content/examples/ngmodules/src/app/contact/contact.service.ts
  27. +1 −1 aio/content/examples/ngmodules/src/app/customers/customers-list.component.ts
  28. +4 −5 aio/content/examples/ngmodules/src/app/customers/customers.service.ts
  29. +1 −1 aio/content/examples/ngmodules/src/app/items/items-list.component.ts
  30. +2 −1 aio/content/examples/ngmodules/src/app/items/items.module.ts
  31. +4 −5 aio/content/examples/ngmodules/src/app/items/items.service.ts
  32. +1 −1 aio/content/examples/observables-in-angular/src/main.ts
  33. +1 −1 aio/content/examples/observables/src/creating.ts
  34. +1 −1 aio/content/examples/observables/src/geolocation.ts
  35. +1 −1 aio/content/examples/observables/src/multicasting.ts
  36. +1 −2 aio/content/examples/observables/src/subscribing.ts
  37. +2 −2 aio/content/examples/pipes/src/app/app.module.ts
  38. +3 −8 aio/content/examples/pipes/src/app/fetch-json.pipe.ts
  39. +11 −10 aio/content/examples/pipes/src/app/hero-async-message.component.ts
  40. +3 −5 aio/content/examples/practical-observable-usage/src/backoff.ts
  41. +2 −2 aio/content/examples/practical-observable-usage/src/typeahead.ts
  42. +5 −3 aio/content/examples/reactive-forms/src/app/demo.component.ts
  43. +3 −3 aio/content/examples/reactive-forms/src/app/hero-list/hero-list.component.ts
  44. +4 −5 aio/content/examples/reactive-forms/src/app/hero.service.ts
  45. +4 −4 aio/content/examples/router/src/app/admin/admin-dashboard.component.2.ts
  46. +4 −4 aio/content/examples/router/src/app/admin/admin-dashboard.component.ts
  47. +6 −5 aio/content/examples/router/src/app/auth.service.ts
  48. +1 −1 aio/content/examples/router/src/app/can-deactivate-guard.service.1.ts
  49. +1 −1 aio/content/examples/router/src/app/can-deactivate-guard.service.ts
  50. +13 −11 aio/content/examples/router/src/app/crisis-center/crisis-detail-resolver.service.ts
  51. +5 −4 aio/content/examples/router/src/app/crisis-center/crisis-detail.component.1.ts
  52. +1 −1 aio/content/examples/router/src/app/crisis-center/crisis-detail.component.ts
  53. +6 −5 aio/content/examples/router/src/app/crisis-center/crisis-list.component.1.ts
  54. +6 −5 aio/content/examples/router/src/app/crisis-center/crisis-list.component.ts
  55. +5 −5 aio/content/examples/router/src/app/crisis-center/crisis.service.ts
  56. +2 −3 aio/content/examples/router/src/app/dialog.service.ts
  57. +6 −5 aio/content/examples/router/src/app/heroes/hero-detail.component.1.ts
  58. +1 −1 aio/content/examples/router/src/app/heroes/hero-detail.component.2.ts
  59. +6 −5 aio/content/examples/router/src/app/heroes/hero-detail.component.ts
  60. +1 −1 aio/content/examples/router/src/app/heroes/hero-list.component.1.ts
  61. +6 −5 aio/content/examples/router/src/app/heroes/hero-list.component.ts
  62. +6 −6 aio/content/examples/router/src/app/heroes/hero.service.ts
  63. +2 −3 aio/content/examples/router/src/app/selective-preloading-strategy.ts
  64. +3 −4 aio/content/examples/rx-library/src/error-handling.ts
  65. +1 −1 aio/content/examples/rx-library/src/naming-convention.ts
  66. +2 −4 aio/content/examples/rx-library/src/operators.1.ts
  67. +3 −5 aio/content/examples/rx-library/src/operators.2.ts
  68. +2 −3 aio/content/examples/rx-library/src/operators.ts
  69. +3 −4 aio/content/examples/rx-library/src/retry-on-error.ts
  70. +4 −4 aio/content/examples/rx-library/src/simple-creation.ts
  71. +1 −1 aio/content/examples/service-worker-getting-started/src/app/check-for-update.service.ts
  72. +5 −4 aio/content/examples/styleguide/src/03-06/app/heroes/shared/hero.service.avoid.ts
  73. +5 −4 aio/content/examples/styleguide/src/03-06/app/heroes/shared/hero.service.ts
  74. +1 −1 aio/content/examples/styleguide/src/04-11/app/core/spinner/spinner.component.ts
  75. +1 −1 aio/content/examples/styleguide/src/04-11/app/core/spinner/spinner.service.ts
  76. +1 −1 aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.avoid.ts
  77. +1 −1 aio/content/examples/styleguide/src/05-04/app/heroes/heroes.component.ts
  78. +5 −4 aio/content/examples/styleguide/src/05-04/app/heroes/shared/hero.service.ts
  79. +7 −9 aio/content/examples/styleguide/src/05-15/app/heroes/hero-list/hero-list.component.avoid.ts
  80. +2 −3 aio/content/examples/styleguide/src/05-15/app/heroes/shared/hero.service.ts
  81. +3 −2 aio/content/examples/styleguide/src/07-01/app/heroes/shared/hero.service.ts
  82. +2 −3 aio/content/examples/styleguide/src/07-03/app/heroes/shared/hero.service.ts
  83. +2 −3 aio/content/examples/styleguide/src/07-04/app/heroes/shared/hero.service.ts
  84. +0 −1 aio/content/examples/styleguide/src/main.ts
  85. +1 −1 aio/content/examples/testing/src/app/demo/async-helper.spec.ts
  86. +1 −1 aio/content/examples/testing/src/app/demo/demo.ts
  87. +1 −1 aio/content/examples/testing/src/app/hero/hero-detail.service.ts
  88. +1 −1 aio/content/examples/testing/src/app/hero/hero-list.component.ts
  89. +1 −2 aio/content/examples/testing/src/app/model/hero.service.ts
  90. +1 −3 aio/content/examples/testing/src/app/model/http-hero.service.spec.ts
  91. +4 −4 aio/content/examples/testing/src/app/model/http-hero.service.ts
  92. +1 −1 aio/content/examples/testing/src/app/model/testing/test-hero.service.ts
  93. +0 −6 aio/content/examples/testing/src/app/twain/twain.component.marbles.spec.ts
  94. +2 −4 aio/content/examples/testing/src/app/twain/twain.component.spec.ts
  95. +1 −2 aio/content/examples/testing/src/app/twain/twain.component.ts
  96. +3 −5 aio/content/examples/testing/src/app/twain/twain.service.ts
  97. +1 −1 aio/content/examples/testing/src/testing/activated-route-stub.ts
  98. +1 −2 aio/content/examples/testing/src/testing/async-observable-helpers.ts
  99. +1 −2 aio/content/examples/toh-pt4/src/app/hero.service.ts
  100. +1 −1 aio/content/examples/toh-pt4/src/app/heroes/heroes.component.1.ts
  101. +1 −2 aio/content/examples/toh-pt5/src/app/hero.service.ts
  102. +1 −3 aio/content/examples/toh-pt6/src/app/hero-search/hero-search.component.ts
  103. +1 −2 aio/content/examples/toh-pt6/src/app/hero.service.ts
  104. +1 −3 aio/content/examples/universal/src/app/hero-search/hero-search.component.ts
  105. +1 −2 aio/content/examples/universal/src/app/hero.service.ts
  106. +11 −8 aio/content/examples/upgrade-module/src/systemjs.config.1.js
  107. +8 −7 aio/content/examples/upgrade-phonecat-2-hybrid/app/core/phone/phone.service.ts
  108. +1 −1 aio/content/examples/upgrade-phonecat-2-hybrid/app/phone-detail/phone-detail.component.spec.ts
  109. +1 −1 aio/content/examples/upgrade-phonecat-2-hybrid/app/phone-list/phone-list.component.spec.ts
  110. +8 −5 aio/content/examples/upgrade-phonecat-2-hybrid/systemjs.config.1.js
  111. +8 −7 aio/content/examples/upgrade-phonecat-3-final/app/core/phone/phone.service.ts
  112. +1 −1 aio/content/examples/upgrade-phonecat-3-final/app/phone-detail/phone-detail.component.spec.ts
  113. +1 −1 aio/content/examples/upgrade-phonecat-3-final/app/phone-list/phone-list.component.spec.ts
  114. +7 −5 aio/content/examples/upgrade-phonecat-3-final/systemjs.config.1.js
  115. +3 −0 aio/content/examples/webpack/src/vendor.ts
  116. +1 −0 aio/tools/examples/shared/boilerplate/cli/tsconfig.json
  117. +5 −3 aio/tools/examples/shared/boilerplate/systemjs/src/systemjs.config.js
  118. +5 −3 aio/tools/examples/shared/boilerplate/systemjs/src/systemjs.config.web.build.js
  119. +5 −3 aio/tools/examples/shared/boilerplate/systemjs/src/systemjs.config.web.js
  120. +25 −105 integration/bazel/yarn.lock
  121. +3 −3 integration/cli-hello-world/package.json
  122. +21 −14 integration/cli-hello-world/yarn.lock
  123. +1 −7 integration/dynamic-compiler/rollup.config.js
  124. +1 −6 integration/dynamic-compiler/rollup.lazy.config.js
  125. +41 −37 integration/dynamic-compiler/yarn.lock
  126. +41 −35 integration/hello_world__closure/yarn.lock
  127. +4 −4 integration/hello_world__render3__cli/package.json
  128. +5,984 −0 integration/hello_world__render3__cli/yarn.lock
  129. +3 −3 integration/hello_world__render3__closure/yarn.lock
  130. +39 −33 integration/hello_world__render3__rollup/yarn.lock
  131. +1 −1 integration/hello_world__systemjs_umd/package.json
  132. +6 −6 integration/hello_world__systemjs_umd/src/systemjs.config.js
  133. +19 −24 integration/hello_world__systemjs_umd/yarn.lock
  134. +41 −35 integration/i18n/yarn.lock
  135. +2,388 −0 integration/injectable-def/yarn.lock
  136. +38 −42 integration/language_service_plugin/yarn.lock
  137. +3 −1 integration/run_tests.sh
  138. +52 −56 integration/typings_test_ts24/yarn.lock
  139. +52 −56 integration/typings_test_ts25/yarn.lock
  140. +52 −56 integration/typings_test_ts26/yarn.lock
  141. +11 −5 modules/benchmarks/src/bootstrap_ng2.ts
  142. +12 −4 modules/benchmarks_external/src/bootstrap.ts
  143. +12 −3 modules/playground/src/bootstrap.ts
  144. +2 −3 modules/playground/src/http/app/http_comp.ts
  145. +8 −3 modules/playground/src/web_workers/animations/loader.js
  146. +6 −3 modules/playground/src/web_workers/images/loader.js
  147. +8 −3 modules/playground/src/web_workers/input/loader.js
  148. +8 −3 modules/playground/src/web_workers/kitchen_sink/loader.js
  149. +8 −3 modules/playground/src/web_workers/message_broker/loader.js
  150. +8 −3 modules/playground/src/web_workers/router/loader.js
  151. +8 −3 modules/playground/src/web_workers/todo/loader.js
  152. +1 −1 package.json
  153. +1 −2 packages/animations/browser/testing/rollup.config.js
  154. +1 −2 packages/animations/rollup.config.js
  155. +2 −150 packages/bazel/src/ng_package/ng_package.bzl
  156. +1 −1 packages/benchpress/package.json
  157. +2 −9 packages/common/http/rollup.config.js
  158. +1 −1 packages/common/http/src/backend.ts
  159. +12 −15 packages/common/http/src/client.ts
  160. +1 −1 packages/common/http/src/interceptor.ts
  161. +2 −3 packages/common/http/src/jsonp.ts
  162. +2 −2 packages/common/http/src/module.ts
  163. +1 −2 packages/common/http/src/xhr.ts
  164. +1 −1 packages/common/http/src/xsrf.ts
  165. +2 −4 packages/common/http/test/client_spec.ts
  166. +3 −2 packages/common/http/test/jsonp_spec.ts
  167. +4 −5 packages/common/http/test/module_spec.ts
  168. +106 −92 packages/common/http/test/xhr_spec.ts
  169. +2 −6 packages/common/http/testing/rollup.config.js
  170. +1 −3 packages/common/http/testing/src/backend.ts
  171. +2 −2 packages/common/http/testing/src/request.ts
  172. +1 −1 packages/common/package.json
  173. +1 −4 packages/common/rollup.config.js
  174. +2 −2 packages/common/src/location/location.ts
  175. +8 −9 packages/common/src/pipes/async_pipe.ts
  176. +1 −3 packages/common/testing/rollup.config.js
  177. +2 −2 packages/common/testing/src/location_mock.ts
  178. +1 −1 packages/compiler-cli/integrationtest/src/features.ts
  179. +1 −2 packages/compiler/rollup.config.js
  180. +2 −0 packages/compiler/test/aot/test_util.ts
  181. +1 −2 packages/compiler/testing/rollup.config.js
  182. +1 −1 packages/core/package.json
  183. +2 −6 packages/core/rollup.config.js
  184. +3 −6 packages/core/src/application_ref.ts
  185. +1 −2 packages/core/src/event_emitter.ts
  186. +1 −1 packages/core/src/linker/query_list.ts
  187. +1 −1 packages/core/src/render3/query.ts
  188. +1 −1 packages/core/src/util/lang.ts
  189. +117 −9 packages/core/test/bundling/hello_world/bundle.golden_symbols.json
  190. +9 −1 packages/core/test/bundling/hello_world/treeshaking_spec.ts
  191. +117 −9 packages/core/test/bundling/injection/bundle.golden_symbols.json
  192. +1 −1 packages/core/test/linker/query_integration_spec.ts
  193. +1 −1 packages/core/test/util/lang_spec.ts
  194. +1 −2 packages/core/testing/rollup.config.js
  195. +2 −4 packages/elements/rollup.config.js
  196. +3 −4 packages/elements/src/component-factory-strategy.ts
  197. +1 −1 packages/elements/src/create-custom-element.ts
  198. +1 −1 packages/elements/src/element-strategy.ts
  199. +1 −1 packages/elements/test/component-factory-strategy_spec.ts
  200. +1 −1 packages/elements/test/create-custom-element_spec.ts
  201. +7 −4 packages/examples/_common/system-config.ts
  202. +1 −1 packages/examples/common/ngIf/ts/module.ts
  203. +1 −2 packages/examples/common/ngTemplateOutlet/ts/module.ts
  204. +2 −3 packages/examples/common/pipes/ts/async_pipe.ts
  205. +1 −1 packages/forms/package.json
  206. +2 −5 packages/forms/rollup.config.js
  207. +1 −1 packages/forms/src/directives/abstract_control_directive.ts
  208. +1 −1 packages/forms/src/directives/validators.ts
  209. +1 −1 packages/forms/src/model.ts
  210. +4 −6 packages/forms/src/validators.ts
  211. +1 −1 packages/forms/test/form_array_spec.ts
  212. +1 −1 packages/forms/test/form_builder_spec.ts
  213. +1 −1 packages/forms/test/form_group_spec.ts
  214. +3 −4 packages/forms/test/reactive_integration_spec.ts
  215. +2 −2 packages/forms/test/template_integration_spec.ts
  216. +21 −16 packages/forms/test/validators_spec.ts
  217. +1 −1 packages/http/package.json
  218. +1 −3 packages/http/rollup.config.js
  219. +1 −2 packages/http/src/backends/jsonp_backend.ts
  220. +1 −2 packages/http/src/backends/xhr_backend.ts
  221. +4 −3 packages/http/src/http.ts
  222. +1 −1 packages/http/test/backends/mock_backend_spec.ts
  223. +1 −2 packages/http/test/http_spec.ts
  224. +2 −4 packages/http/testing/rollup.config.js
  225. +3 −4 packages/http/testing/src/mock_backend.ts
  226. +2 −3 packages/language-service/rollup.config.js
  227. +2 −7 packages/platform-server/rollup.config.js
  228. +2 −4 packages/platform-server/src/http.ts
  229. +1 −1 packages/platform-server/src/location.ts
  230. +3 −5 packages/platform-server/src/utils.ts
  231. +4 −7 packages/platform-server/test/integration_spec.ts
  232. +1 −2 packages/platform-webworker/rollup.config.js
  233. +9 −2 packages/router/karma-test-shim.js
  234. +1 −3 packages/router/karma.conf.js
  235. +1 −1 packages/router/package.json
  236. +2 −25 packages/router/rollup.config.js
  237. +57 −71 packages/router/src/apply_redirects.ts
  238. +2 −2 packages/router/src/config.ts
  239. +2 −2 packages/router/src/create_router_state.ts
  240. +4 −3 packages/router/src/directives/router_link.ts
  241. +6 −3 packages/router/src/directives/router_link_active.ts
  242. +1 −1 packages/router/src/interfaces.ts
  243. +43 −50 packages/router/src/pre_activation.ts
  244. +1 −3 packages/router/src/recognize.ts
  245. +84 −85 packages/router/src/router.ts
  246. +10 −12 packages/router/src/router_config_loader.ts
  247. +4 −3 packages/router/src/router_module.ts
  248. +12 −15 packages/router/src/router_preloader.ts
  249. +4 −5 packages/router/src/router_state.ts
  250. +7 −15 packages/router/src/utils/collection.ts
  251. +1 −2 packages/router/test/apply_redirects.spec.ts
  252. +2 −2 packages/router/test/create_url_tree.spec.ts
  253. +9 −12 packages/router/test/integration.spec.ts
  254. +1 −1 packages/router/test/router_state.spec.ts
  255. +2 −22 packages/service-worker/rollup.config.js
  256. +44 −58 packages/service-worker/src/low_level.ts
  257. +5 −9 packages/service-worker/src/module.ts
  258. +21 −29 packages/service-worker/src/push.ts
  259. +6 −8 packages/service-worker/src/update.ts
  260. +0 −1 packages/service-worker/test/comm_spec.ts
  261. +4 −6 packages/service-worker/test/integration_spec.ts
  262. +1 −1 packages/service-worker/testing/mock.ts
  263. +1 −1 packages/service-worker/worker/testing/scope.ts
  264. +2 −5 packages/upgrade/rollup.config.js
  265. +6 −5 scripts/ci/offline_compiler_test.sh
  266. +6 −4 test-main.js
  267. +9 −3 tools/postinstall-patches.js
  268. +1 −1 tools/public_api_guard/common/common.d.ts
  269. +1 −1 tools/public_api_guard/common/testing.d.ts
  270. +5 −9 yarn.lock
@@ -2,7 +2,7 @@
import { Component, Input, OnDestroy } from '@angular/core';

import { MissionService } from './mission.service';
import { Subscription } from 'rxjs/Subscription';
import { Subscription } from 'rxjs';

@Component({
selector: 'app-astronaut',
@@ -1,6 +1,6 @@
// #docregion
import { Injectable } from '@angular/core';
import { Subject } from 'rxjs/Subject';
import { Subject } from 'rxjs';

@Injectable()
export class MissionService {
@@ -1,6 +1,6 @@
// #docregion
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { Hero, HeroTaxReturn } from './hero';
import { HeroesService } from './heroes.service';
@@ -1,7 +1,6 @@
import { Injectable } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { Observer } from 'rxjs/Observer';
import { Observable, Observer } from 'rxjs';

import { Hero, HeroTaxReturn } from './hero';

@@ -1,6 +1,6 @@
// #docregion
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { Villain, VillainsService } from './villains.service';

@@ -1,6 +1,6 @@
import { Injectable } from '@angular/core';

import { of } from 'rxjs/observable/of';
import { of } from 'rxjs';

export interface Villain { id: number; name: string; }

@@ -30,7 +30,7 @@ export class ConfigComponent {
this.configService.getConfig()
// #enddocregion v1, v2
.subscribe(
data => this.config = { ...data }, // success path
(data: Config) => this.config = { ...data }, // success path
error => this.error = error // error path
);
}
@@ -39,7 +39,7 @@ export class ConfigComponent {
showConfig_v1() {
this.configService.getConfig_1()
// #docregion v1, v1_callback
.subscribe(data => this.config = {
.subscribe((data: Config) => this.config = {
heroesUrl: data['heroesUrl'],
textfile: data['textfile']
});
@@ -51,7 +51,7 @@ export class ConfigComponent {
this.configService.getConfig()
// #docregion v2, v2_callback
// clone the data object, using its known Config shape
.subscribe(data => this.config = { ...data });
.subscribe((data: Config) => this.config = { ...data });
// #enddocregion v2_callback
}
// #enddocregion v2
@@ -6,8 +6,7 @@ import { HttpClient } from '@angular/common/http';
import { HttpErrorResponse, HttpResponse } from '@angular/common/http';

// #docregion rxjs-imports
import { Observable } from 'rxjs/Observable';
import { ErrorObservable } from 'rxjs/observable/ErrorObservable';
import { Observable, throwError } from 'rxjs';
import { catchError, retry } from 'rxjs/operators';
// #enddocregion rxjs-imports

@@ -82,8 +81,8 @@ export class ConfigService {
`Backend returned code ${error.status}, ` +
`body was: ${error.error}`);
}
// return an ErrorObservable with a user-facing error message
return new ErrorObservable(
// return an observable with a user-facing error message
return throwError(
'Something bad happened; please try again later.');
};
// #enddocregion handleError
@@ -6,8 +6,7 @@ import { HttpHeaders } from '@angular/common/http';

// #enddocregion http-options

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable } from 'rxjs';
import { catchError } from 'rxjs/operators';

import { Hero } from './hero';
@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpErrorResponse } from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';

import { MessageService } from './message.service';

@@ -4,8 +4,6 @@ import {
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';

// #docregion
import { AuthService } from '../auth.service';

@@ -5,8 +5,7 @@ import {
HttpInterceptor, HttpHandler
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';
import { startWith, tap } from 'rxjs/operators';

import { RequestCache } from '../request-cache.service';
@@ -3,7 +3,7 @@ import {
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

@Injectable()
export class EnsureHttpsInterceptor implements HttpInterceptor {
@@ -4,7 +4,6 @@ import {
HttpRequest, HttpResponse
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
// #docregion excerpt
import { finalize, tap } from 'rxjs/operators';
import { MessageService } from '../message.service';
@@ -3,7 +3,7 @@ import {
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

/** Pass untouched request through to the next request handler. */
@Injectable()
@@ -3,7 +3,7 @@ import {
HttpEvent, HttpInterceptor, HttpHandler, HttpRequest
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

@Injectable()
export class TrimNameInterceptor implements HttpInterceptor {
@@ -5,8 +5,7 @@ import {
HttpEventType, HttpProgressEvent
} from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable } from 'rxjs';

/** Simulate server replying to file upload request */
@Injectable()
@@ -1,7 +1,6 @@
import { Component, OnInit } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { Subject } from 'rxjs/Subject';
import { Observable, Subject } from 'rxjs';
import { debounceTime, distinctUntilChanged, switchMap } from 'rxjs/operators';

import { NpmPackageInfo, PackageSearchService } from './package-search.service';
@@ -1,8 +1,7 @@
import { Injectable } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams } from '@angular/common/http';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';
import { catchError, map } from 'rxjs/operators';

import { HttpErrorHandler, HandleError } from '../http-error-handler.service';
@@ -4,7 +4,7 @@ import {
HttpRequest, HttpResponse, HttpErrorResponse
} from '@angular/common/http';

import { of } from 'rxjs/observable/of';
import { of } from 'rxjs';
import { catchError, last, map, tap } from 'rxjs/operators';

import { MessageService } from '../message.service';
@@ -2,8 +2,7 @@
// #docregion
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Contact {
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { Crisis,
CrisisService } from './crisis.service';
@@ -1,7 +1,6 @@
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Crisis {
@@ -1,5 +1,5 @@
import { Component } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { Hero,
HeroService } from './hero.service';
@@ -1,7 +1,6 @@
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Hero {
@@ -1,8 +1,7 @@
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { delay } from 'rxjs/operator/delay';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Contact {
constructor(public id: number, public name: string) { }
@@ -24,12 +23,12 @@ export class ContactService implements OnDestroy {
ngOnDestroy() { console.log('ContactService instance destroyed.'); }

getContacts(): Observable<Contact[]> {
return delay.call(of(CONTACTS), FETCH_LATENCY);
return of(CONTACTS).pipe(delay(FETCH_LATENCY));
}

getContact(id: number | string): Observable<Contact> {
const contact$ = of(CONTACTS.find(contact => contact.id === +id));
return delay.call(contact$, FETCH_LATENCY);
return contact$.pipe(delay(FETCH_LATENCY));
}
}

@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

import { Customer,
CustomersService } from './customers.service';
@@ -1,8 +1,7 @@
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { delay } from 'rxjs/operator/delay';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Customer {
constructor(public id: number, public name: string) { }
@@ -27,11 +26,11 @@ export class CustomersService implements OnDestroy {
ngOnDestroy() { console.log('CustomersService instance destroyed.'); }

getCustomers(): Observable<Customer[]> {
return delay.call(of(CUSTOMERS), FETCH_LATENCY);
return of(CUSTOMERS).pipe(delay(FETCH_LATENCY));
}

getCustomer(id: number | string): Observable<Customer> {
const customer$ = of(CUSTOMERS.find(customer => customer.id === +id));
return delay.call(customer$, FETCH_LATENCY);
return customer$.pipe(delay(FETCH_LATENCY));
}
}
@@ -1,5 +1,5 @@
import { Component, OnInit } from '@angular/core';
import { Observable }from 'rxjs/Observable';
import { Observable }from 'rxjs';

import { Item,
ItemService } from './items.service';
@@ -1,14 +1,15 @@
import { NgModule } from '@angular/core';
import { CommonModule } from '@angular/common';

import { ItemsComponent } from './items.component';
import { ItemsListComponent } from './items-list.component';
import { ItemsDetailComponent } from './items-detail.component';
import { ItemService } from './items.service';
import { ItemsRoutingModule } from './items-routing.module';

@NgModule({
imports: [ CommonModule, ItemsRoutingModule ],
declarations: [ ItemsDetailComponent, ItemsListComponent ],
declarations: [ ItemsComponent, ItemsDetailComponent, ItemsListComponent ],
providers: [ ItemService ]
})
export class ItemsModule {}
@@ -1,8 +1,7 @@
import { Injectable, OnDestroy } from '@angular/core';

import { Observable } from 'rxjs/Observable';
import { of } from 'rxjs/observable/of';
import { delay } from 'rxjs/operator/delay';
import { Observable, of } from 'rxjs';
import { delay } from 'rxjs/operators';

export class Item {
constructor(public id: number, public name: string) { }
@@ -25,12 +24,12 @@ export class ItemService implements OnDestroy {
ngOnDestroy() { console.log('ItemService instance destroyed.'); }

getItems(): Observable<Item[]> {
return delay.call(of(ITEMS), FETCH_LATENCY);
return of(ITEMS).pipe(delay(FETCH_LATENCY));
}

getItem(id: number | string): Observable<Item> {
const item$ = of(ITEMS.find(item => item.id === +id));
return delay.call(item$, FETCH_LATENCY);
return item$.pipe(delay(FETCH_LATENCY));
}
}

@@ -1,6 +1,6 @@

import { Component, Output, OnInit, EventEmitter, NgModule } from '@angular/core';
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

// #docregion eventemitter

@@ -1,5 +1,5 @@

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

// #docregion subscriber

@@ -1,4 +1,4 @@
import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

// #docregion

@@ -1,5 +1,5 @@

import { Observable } from 'rxjs/Observable';
import { Observable } from 'rxjs';

// #docregion delay_sequence

@@ -1,6 +1,5 @@

import { Observable } from 'rxjs/Observable';
import 'rxjs/add/observable/of';
import { Observable, of } from 'rxjs';

// #docregion observer

0 comments on commit b43f8bc

Please sign in to comment.
You can’t perform that action at this time.