This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Component } from '@angular/core'; | |
| import { BaseHistoryEntryComponent } from './base-history-entry.component'; | |
| @Component({ | |
| selector: 'workflow-ended-history-entry', | |
| template: `<div>The workflow took {{ data | number }}ms to complete</div>`, | |
| }) | |
| export class WorkflowEndedHistoryEntryComponent extends BaseHistoryEntryComponent<number> {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Directive, Input } from '@angular/core'; | |
| @Directive({}) | |
| export class BaseHistoryEntryComponent<T> { | |
| @Input() | |
| public data: T; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public entries: HistoryEntry[] = [ | |
| { | |
| type: 1, | |
| data: null, | |
| }, | |
| { | |
| type: 2, | |
| data: '2021-10-09T15:32:15.456Z', | |
| }, | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function foo() { | |
| console.log('Hello'); | |
| bar(); | |
| } | |
| function bar() { | |
| console.log('Good bye') | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable } from 'rxjs'; | |
| import { delay, retryWhen } from 'rxjs/operators'; | |
| observable | |
| .pipe( | |
| retryWhen(errors => errors. | |
| pipe( | |
| delay(2500) | |
| ) | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { interval, Observable } from 'rxjs'; | |
| import { retryWhen } from 'rxjs/operators'; | |
| observable | |
| .pipe( | |
| retryWhen(errors => interval(2500)) | |
| ) | |
| .subscribe({ | |
| next: x => console.log(`${x} received`), | |
| complete: () => console.log('Completed'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable } from 'rxjs'; | |
| import { retryWhen, take } from 'rxjs/operators'; | |
| observable | |
| .pipe( | |
| retryWhen(errors => errors.pipe(take(2))) | |
| ) | |
| .subscribe({ | |
| next: x => console.log(`${x} received`), | |
| complete: () => console.log('Completed'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable } from 'rxjs'; | |
| import { retryWhen, tap } from 'rxjs/operators'; | |
| const observable = new Observable<number>(observer => { | |
| let x = 0; | |
| const interval = setInterval(() => { | |
| if (x === 5) { | |
| observer.error('Oops'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable, of, throwError } from 'rxjs'; | |
| import { catchError, finalize, map } from 'rxjs/operators'; | |
| const observable = new Observable<number>(observer => { | |
| let x = 0; | |
| const interval = setInterval(() => { | |
| if (x === 0) { | |
| observer.error('Oops'); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { Observable, of } from 'rxjs'; | |
| import { catchError, finalize } from 'rxjs/operators'; | |
| const observable = new Observable<number>(observer => { | |
| let x = 0; | |
| const interval = setInterval(() => { | |
| if (x === 5) { | |
| observer.error('Oops'); | |
| } |