From f6c91c5a5a3d0dd2d573c87cf276d20247c5d49f Mon Sep 17 00:00:00 2001 From: Zheng Kai Date: Tue, 4 Dec 2018 07:41:17 +0800 Subject: [PATCH] docs: update rxjs example and change fromPromise to from (#27443) the first example at https://angular.io/guide/rx-library, https://github.com/ReactiveX/rxjs-tslint/issues/7 PR Close #27443 --- aio/content/examples/rx-library/src/simple-creation.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/aio/content/examples/rx-library/src/simple-creation.ts b/aio/content/examples/rx-library/src/simple-creation.ts index 810e398e85..9c576ffca0 100644 --- a/aio/content/examples/rx-library/src/simple-creation.ts +++ b/aio/content/examples/rx-library/src/simple-creation.ts @@ -1,10 +1,10 @@ // #docregion promise -import { fromPromise } from 'rxjs'; +import { from } from 'rxjs'; // Create an Observable out of a promise -const data = fromPromise(fetch('/api/endpoint')); +const data = from(fetch('/api/endpoint')); // Subscribe to begin listening for async result data.subscribe({ next(response) { console.log(response); },