windowed-observable icon indicating copy to clipboard operation
windowed-observable copied to clipboard

Add async pipe support

Open Adrian1907 opened this issue 3 years ago • 3 comments
trafficstars

Describe the feature you'd like:

I would like to have a possibility to use windowed-observable directly in a html-template via async pipe.

Adrian1907 avatar Jun 07 '22 10:06 Adrian1907

Hi @Adrian1907 thanks for your issue, but could you elaborate on the request with a few examples, suggestions of API, and usages?

luistak avatar Jun 07 '22 11:06 luistak

Hi @luistak, the build-in async pipe allows to use asyncronuous things like Observable or Promise in a template. Source: https://angular.io/api/common/AsyncPipe It would be nice to have a possibility to use windowed-observable the same way as usual observable and not only with subscribe. For example the next way:

import { Observable as WindowedObservable } from 'windowed-observable';

@Component({
  selector: 'my-selector',
  template: '<div>{{ myWindowedObservable | async }}</div>'
})
export class ExampleComponent {
  myWindowedObservable = new WindowedObservable('myNameSpace');
}

Adrian1907 avatar Jun 07 '22 12:06 Adrian1907

@Adrian1907 I know my message comes kind of late. Did you try wrapping windowObservable in a the RXJS from() ? Don't know if it will work, but I think there's a slight chance.

jsanta avatar Jul 27 '23 10:07 jsanta