Recently I've found out that you can use any observable on @Output-decorated property and it will work. I wonder if there are any potential pitfalls?
// Both components and directives
@Component({...})
export class MyComponent {
// Any subject/observable as output
@Output()
public myEvent = fromEvent(this.elRef.nativeElement, 'click').pipe(
map(() => 'Clicked!'),
finalize(() => console.log('unsubscribed!'))
);
constructor(private elRef: ElementRef<HTMLElement>) {}
}