-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: only infer types of inputs and outputs Release-As: 0.3.0
- Loading branch information
Showing
11 changed files
with
118 additions
and
128 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { type Observable, of, throwError } from 'rxjs'; | ||
import { delay } from 'rxjs/operators'; | ||
|
||
export class CounterApiService { | ||
public increaseBy$(amount: number, count: number): Observable<CounterApiResponse> { | ||
if (amount > 0 && count >= 5) { | ||
return throwError(() => new RangeError('Count is too high')); | ||
} | ||
|
||
if (amount < 0 && count <= 0) { | ||
return throwError(() => new RangeError('Count is too low')); | ||
} | ||
|
||
return of({ count: count + amount }).pipe(delay(250)); | ||
} | ||
} | ||
|
||
export interface CounterApiResponse { | ||
count: number; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
<output aria-label="Current count">{{ value() }}</output> | ||
|
||
<button mat-fab type="button" aria-label="Increase" title="Increase" [disabled]="isBusy()" (click)="increase()"> | ||
<button mat-fab type="button" aria-label="Increase" title="Increase" [disabled]="isBusy()" (click)="increaseBy(1)"> | ||
<mat-icon fontIcon="exposure_plus_1" /> | ||
</button> | ||
|
||
<button mat-fab type="button" aria-label="Decrease" title="Decrease" [disabled]="isBusy()" (click)="decrease()"> | ||
<button mat-fab type="button" aria-label="Decrease" title="Decrease" [disabled]="isBusy()" (click)="increaseBy(-1)"> | ||
<mat-icon fontIcon="exposure_neg_1" /> | ||
</button> |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.