Getting Started
Writing content
API Documentation
Customization
Recipes
API References Develop
@ng-doc/builder / Function

whenDone

Generic types:T O

Operator function that projects each source value to an Observable which is merged in the output Observable, only if the source value is a BuilderDone state.

The project function is applied to each value emitted by the source Observable. If the source value is a BuilderDone state, the project function is called with the result of the BuilderDone state and the index as arguments, and the returned Observable is merged into the output Observable. If the source value is not a BuilderDone state, it is emitted directly to the output Observable.

Presentation

function whenDone(
  project: (
    value: T,
    index: number,
  ) => ObservableInput<BuilderState<ObservedValueOf<O>>>,
): OperatorFunction<BuilderState<T>, BuilderState<ObservedValueOf<O>>>;

Returns

OperatorFunction<BuilderState<T>, BuilderState<ObservedValueOf<O>>> -

{OperatorFunction} - An OperatorFunction that emits the items from the source Observable or the projected Observables.

Parameters

NameTypeDescription
project
(value: T, index: number) => ObservableInput<BuilderState<ObservedValueOf<O>>>