From bfce759e845ef6541674ce61859336f201c68442 Mon Sep 17 00:00:00 2001 From: John White Date: Thu, 15 Apr 2021 14:20:23 -0400 Subject: [PATCH] Simplify the observable --- .../public/modules/radio/radio.component.ts | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/src/app/public/modules/radio/radio.component.ts b/src/app/public/modules/radio/radio.component.ts index ad5f5be6..0470c137 100644 --- a/src/app/public/modules/radio/radio.component.ts +++ b/src/app/public/modules/radio/radio.component.ts @@ -17,7 +17,8 @@ import { import { BehaviorSubject, - Observable + Observable, + Subject } from 'rxjs'; import { @@ -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(); + /** * Indicates whether the radio button is selected. * @default false @@ -216,13 +222,6 @@ export class SkyRadioComponent implements OnDestroy, ControlValueAccessor { } } - /** - * Fires when users focus off a radio button. - */ - public get blur(): Observable { - return this._blur; - } - /** * Fires when users select a radio button. */ @@ -253,7 +252,6 @@ export class SkyRadioComponent implements OnDestroy, ControlValueAccessor { } private _change = new EventEmitter(); - private _blur = new EventEmitter(); private _checked = false; private _checkedChange = new BehaviorSubject(this._checked); private _disabled: boolean = false; @@ -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 */