Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ajust example iif #6704

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 15 additions & 14 deletions src/internal/observable/iif.ts
Expand Up @@ -49,26 +49,27 @@ import { ObservableInput } from '../types';
* const observableIfYouHaveAccess = iif(
* () => accessGranted,
* of('It seems you have an access...'), // Note that only one Observable is passed to the operator.
* of('error')
* );
*
*
* accessGranted = true;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end'),
* );
*
* observableIfYouHaveAccess.subscribe({
* next: (value) => console.log(value),
* error: (err) => {},
* complete: () => console.log('The end'),
* });
*
* // Logs:
* // "It seems you have an access..."
* // "The end"
*
*
* accessGranted = false;
* observableIfYouHaveAccess.subscribe(
* value => console.log(value),
* err => {},
* () => console.log('The end'),
* );
*
* observableIfYouHaveAccess.subscribe({
* next: (value) => console.log(value),
* error: console.error,
* complete: () => console.log('The end'),
* });
*
* // Logs:
* // "The end"
* ```
Expand Down