Skip to content
This repository has been archived by the owner on Dec 8, 2022. It is now read-only.

Commit

Permalink
Simplify the observable
Browse files Browse the repository at this point in the history
  • Loading branch information
johnhwhite committed Apr 15, 2021
1 parent 5a1da12 commit bfce759
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions src/app/public/modules/radio/radio.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ import {

import {
BehaviorSubject,
Observable
Observable,
Subject
} from 'rxjs';

import {
Expand Down Expand Up @@ -61,6 +62,11 @@ const SKY_RADIO_CONTROL_VALUE_ACCESSOR: Provider = {
})
export class SkyRadioComponent implements OnDestroy, ControlValueAccessor {

/**
* Fires when users focus off a radio button.
*/
public blur = new Subject<void>();

/**
* Indicates whether the radio button is selected.
* @default false
Expand Down Expand Up @@ -216,13 +222,6 @@ export class SkyRadioComponent implements OnDestroy, ControlValueAccessor {
}
}

/**
* Fires when users focus off a radio button.
*/
public get blur(): Observable<undefined> {
return this._blur;
}

/**
* Fires when users select a radio button.
*/
Expand Down Expand Up @@ -253,7 +252,6 @@ export class SkyRadioComponent implements OnDestroy, ControlValueAccessor {
}

private _change = new EventEmitter<SkyRadioChange>();
private _blur = new EventEmitter<undefined>();
private _checked = false;
private _checkedChange = new BehaviorSubject<boolean>(this._checked);
private _disabled: boolean = false;
Expand Down Expand Up @@ -315,7 +313,7 @@ export class SkyRadioComponent implements OnDestroy, ControlValueAccessor {

public onInputFocusChange(event: Event): void {
this.onTouchedCallback();
this._blur.emit();
this.blur.next();
}

/* istanbul ignore next */
Expand Down

0 comments on commit bfce759

Please sign in to comment.