Skip to content

docs-bug(cdk/testing): change-detection's parallel methods aren't visible in the docs #22013

@Splaktar

Description

@Splaktar

Documentation Feedback

There are a lot of comments around the various parallel() functions, but the docs don't have any information at all:

/**
* Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
* detection over the entire operation such that change detection occurs exactly once before
* resolving the values and once after.
* @param values A getter for the async values to resolve in parallel with batched change detection.
* @return The resolved values.
*/
export function parallel<T1, T2, T3, T4, T5>(
values: () =>
[T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>,
T5 | PromiseLike<T5>
]): Promise<[T1, T2, T3, T4, T5]>;
/**
* Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
* detection over the entire operation such that change detection occurs exactly once before
* resolving the values and once after.
* @param values A getter for the async values to resolve in parallel with batched change detection.
* @return The resolved values.
*/
export function parallel<T1, T2, T3, T4>(
values: () =>
[T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>, T4 | PromiseLike<T4>]):
Promise<[T1, T2, T3, T4]>;
/**
* Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
* detection over the entire operation such that change detection occurs exactly once before
* resolving the values and once after.
* @param values A getter for the async values to resolve in parallel with batched change detection.
* @return The resolved values.
*/
export function parallel<T1, T2, T3>(
values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>, T3 | PromiseLike<T3>]):
Promise<[T1, T2, T3]>;
/**
* Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
* detection over the entire operation such that change detection occurs exactly once before
* resolving the values and once after.
* @param values A getter for the async values to resolve in parallel with batched change detection.
* @return The resolved values.
*/
export function parallel<T1, T2>(values: () => [T1 | PromiseLike<T1>, T2 | PromiseLike<T2>]):
Promise<[T1, T2]>;
/**
* Resolves the given list of async values in parallel (i.e. via Promise.all) while batching change
* detection over the entire operation such that change detection occurs exactly once before
* resolving the values and once after.
* @param values A getter for the async values to resolve in parallel with batched change detection.
* @return The resolved values.
*/
export function parallel<T>(values: () => (T | PromiseLike<T>)[]): Promise<T[]>;
export async function parallel<T>(values: () => Iterable<T | PromiseLike<T>>): Promise<T[]> {
return batchChangeDetection(() => Promise.all(values()), true);
}

This was raised in today's Creating Harnesses call with the community: AngularCommunity/angular-missions#5

Affected documentation page: https://material.angular.io/cdk/test-harnesses/api#cdk-testing-functions

Screen Shot 2021-02-24 at 15 35 57

Need to investigate if this belongs in this repo or if it's a docs-infra issue that should be moved to the material.angular.io repo.

Metadata

Metadata

Assignees

Labels

P3An issue that is relevant to core functions, but does not impede progress. Important, but not urgentarea: cdk/testingdocsThis issue is related to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions