feat(ivy): memoize array literals in render3 (#21973)

PR Close #21973
This commit is contained in:
Kara Erickson
2018-02-01 12:13:23 -08:00
committed by Alex Rickabaugh
parent 7e51e52f55
commit 4d62be69c5
6 changed files with 618 additions and 1 deletions

View File

@ -494,7 +494,8 @@ export function createTView(): TView {
contentCheckHooks: null,
viewHooks: null,
viewCheckHooks: null,
destroyHooks: null
destroyHooks: null,
objectLiterals: null
};
}
@ -1754,6 +1755,10 @@ export function getRenderer(): Renderer3 {
return renderer;
}
export function getTView(): TView {
return currentView.tView;
}
export function getDirectiveInstance<T>(instanceOrArray: T | [T]): T {
// Directives with content queries store an array in data[directiveIndex]
// with the instance as the first index