refactor(ivy): combine query load instructions (#32100)

Combines the `loadViewQuery` and `loadContentQuery` instructions since they have the exact same internal logic. Based on a discussion here: https://github.com/angular/angular/pull/32067#pullrequestreview-273001730

PR Close #32100
This commit is contained in:
Kristiyan Kostadinov
2019-08-12 11:27:18 +03:00
committed by Kara Erickson
parent 6eb9c2fab0
commit 4ea3e7e000
11 changed files with 90 additions and 108 deletions

View File

@ -95,9 +95,8 @@ export {
ɵɵviewQuery,
ɵɵstaticViewQuery,
ɵɵstaticContentQuery,
ɵɵloadViewQuery,
ɵɵcontentQuery,
ɵɵloadContentQuery,
ɵɵloadQuery,
ɵɵelementEnd,
ɵɵhostProperty,
ɵɵproperty,

View File

@ -178,9 +178,8 @@ export {
ɵɵqueryRefresh,
ɵɵviewQuery,
ɵɵstaticViewQuery,
ɵɵloadViewQuery,
ɵɵloadQuery,
ɵɵcontentQuery,
ɵɵloadContentQuery,
ɵɵstaticContentQuery
} from './query';

View File

@ -103,9 +103,8 @@ export const angularCoreEnv: {[name: string]: Function} =
'ɵɵviewQuery': r3.ɵɵviewQuery,
'ɵɵstaticViewQuery': r3.ɵɵstaticViewQuery,
'ɵɵstaticContentQuery': r3.ɵɵstaticContentQuery,
'ɵɵloadViewQuery': r3.ɵɵloadViewQuery,
'ɵɵloadQuery': r3.ɵɵloadQuery,
'ɵɵcontentQuery': r3.ɵɵcontentQuery,
'ɵɵloadContentQuery': r3.ɵɵloadContentQuery,
'ɵɵreference': r3.ɵɵreference,
'ɵɵelementHostAttrs': r3.ɵɵelementHostAttrs,
'ɵɵclassMap': r3.ɵɵclassMap,

View File

@ -448,15 +448,6 @@ function viewQueryInternal<T>(
createLQuery<T>(lView);
}
/**
* Loads a QueryList corresponding to the current view query.
*
* @codeGenApi
*/
export function ɵɵloadViewQuery<T>(): QueryList<T> {
return loadQueryInternal<T>(getLView(), getCurrentQueryIndex());
}
/**
* Registers a QueryList, associated with a content query, for later refresh (part of a view
* refresh).
@ -509,11 +500,11 @@ function contentQueryInternal<T>(
}
/**
* Loads a QueryList corresponding to the current content query.
* Loads a QueryList corresponding to the current view or content query.
*
* @codeGenApi
*/
export function ɵɵloadContentQuery<T>(): QueryList<T> {
export function ɵɵloadQuery<T>(): QueryList<T> {
return loadQueryInternal<T>(getLView(), getCurrentQueryIndex());
}