refactor(compiler): remove unused `subscriptions` in view
This commit is contained in:
parent
1de04b23b1
commit
97471d74b6
|
@ -49,7 +49,6 @@ export class CompileView implements NameResolver {
|
||||||
public fields: o.ClassField[] = [];
|
public fields: o.ClassField[] = [];
|
||||||
public getters: o.ClassGetter[] = [];
|
public getters: o.ClassGetter[] = [];
|
||||||
public disposables: o.Expression[] = [];
|
public disposables: o.Expression[] = [];
|
||||||
public subscriptions: o.Expression[] = [];
|
|
||||||
|
|
||||||
public componentView: CompileView;
|
public componentView: CompileView;
|
||||||
public purePipes = new Map<string, CompilePipe>();
|
public purePipes = new Map<string, CompilePipe>();
|
||||||
|
|
|
@ -541,8 +541,8 @@ function generateCreateMethod(view: CompileView): o.Statement[] {
|
||||||
'init',
|
'init',
|
||||||
[
|
[
|
||||||
createFlatArray(view.rootNodesOrAppElements),
|
createFlatArray(view.rootNodesOrAppElements),
|
||||||
o.literalArr(view.nodes.map(node => node.renderNode)), o.literalArr(view.disposables),
|
o.literalArr(view.nodes.map(node => node.renderNode)),
|
||||||
o.literalArr(view.subscriptions)
|
o.literalArr(view.disposables),
|
||||||
])
|
])
|
||||||
.toStmt(),
|
.toStmt(),
|
||||||
new o.ReturnStatement(resultExpr)
|
new o.ReturnStatement(resultExpr)
|
||||||
|
|
|
@ -33,7 +33,6 @@ export abstract class AppView<T> {
|
||||||
rootNodesOrAppElements: any[];
|
rootNodesOrAppElements: any[];
|
||||||
allNodes: any[];
|
allNodes: any[];
|
||||||
disposables: Function[];
|
disposables: Function[];
|
||||||
subscriptions: any[];
|
|
||||||
contentChildren: AppView<any>[] = [];
|
contentChildren: AppView<any>[] = [];
|
||||||
viewChildren: AppView<any>[] = [];
|
viewChildren: AppView<any>[] = [];
|
||||||
viewContainerElement: AppElement = null;
|
viewContainerElement: AppElement = null;
|
||||||
|
@ -98,13 +97,10 @@ export abstract class AppView<T> {
|
||||||
*/
|
*/
|
||||||
createInternal(rootSelectorOrNode: string|any): AppElement { return null; }
|
createInternal(rootSelectorOrNode: string|any): AppElement { return null; }
|
||||||
|
|
||||||
init(
|
init(rootNodesOrAppElements: any[], allNodes: any[], disposables: Function[]) {
|
||||||
rootNodesOrAppElements: any[], allNodes: any[], disposables: Function[],
|
|
||||||
subscriptions: any[]) {
|
|
||||||
this.rootNodesOrAppElements = rootNodesOrAppElements;
|
this.rootNodesOrAppElements = rootNodesOrAppElements;
|
||||||
this.allNodes = allNodes;
|
this.allNodes = allNodes;
|
||||||
this.disposables = disposables;
|
this.disposables = disposables;
|
||||||
this.subscriptions = subscriptions;
|
|
||||||
if (this.type === ViewType.COMPONENT) {
|
if (this.type === ViewType.COMPONENT) {
|
||||||
// Note: the render nodes have been attached to their host element
|
// Note: the render nodes have been attached to their host element
|
||||||
// in the ViewFactory already.
|
// in the ViewFactory already.
|
||||||
|
@ -164,9 +160,6 @@ export abstract class AppView<T> {
|
||||||
for (var i = 0; i < this.disposables.length; i++) {
|
for (var i = 0; i < this.disposables.length; i++) {
|
||||||
this.disposables[i]();
|
this.disposables[i]();
|
||||||
}
|
}
|
||||||
for (var i = 0; i < this.subscriptions.length; i++) {
|
|
||||||
this.subscriptions[i].unsubscribe();
|
|
||||||
}
|
|
||||||
this.destroyInternal();
|
this.destroyInternal();
|
||||||
this.dirtyParentQueriesInternal();
|
this.dirtyParentQueriesInternal();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue