Refactor views to support dynamic updates.
This commit is contained in:
@@ -0,0 +1,15 @@
|
||||
import { ViewContext } from "view";
|
||||
import { View } from "../../../view/view";
|
||||
import { ViewModifier } from "../types";
|
||||
|
||||
export class RemoveContextViewModifier implements ViewModifier {
|
||||
protected _keys: (keyof ViewContext)[];
|
||||
|
||||
constructor(keys: (keyof ViewContext)[]) {
|
||||
this._keys = keys;
|
||||
}
|
||||
|
||||
public modify(view: View): void {
|
||||
this._keys.forEach((key) => view.removeContext(key));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user