Check out the code snippet below:
export function featureComplete(feature: BaseFeatureService) {
return pipe(
combineLatest([feature.loading$]),
filter(([input, loading]) => !loading),
map(([input, loading]) => {
return input;
})
);
}
To use this function, simply modify your observable like so:
observable$.pipe(
featureComplete(this.propertyFeatureService)
);
The combineLatest
operator should be used instead of zip
, as the latter is deprecated. This adjustment will ensure that your solution continues to work effectively.
If you prefer, you can also pass in an `Observable` for the waiting condition by using feature.loading$
.
Thank you for considering these alternatives!