mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Add ko.untrack() to knockout.es5
See 75773a52f5/src/knockout-es5.js (L196)
This commit is contained in:
parent
dff8e2c625
commit
ed3f222909
@ -54,6 +54,11 @@ class OrderLine {
|
||||
public getSubtotal(): string {
|
||||
return "$" + (this.price * this.quantity).toFixed(2);
|
||||
}
|
||||
|
||||
public dispose() {
|
||||
// Dispose of all the observables of this object to prevent memory leaks
|
||||
ko.untrack(this);
|
||||
}
|
||||
}
|
||||
|
||||
class Order {
|
||||
@ -83,4 +88,4 @@ anOrder.lines.removeAll();
|
||||
|
||||
anOrder.lines.destroy(someOrderLine);
|
||||
anOrder.lines.destroyAll([someOrderLine]);
|
||||
anOrder.lines.destroyAll();
|
||||
anOrder.lines.destroyAll();
|
||||
|
||||
3
knockout.es5/knockout.es5.d.ts
vendored
3
knockout.es5/knockout.es5.d.ts
vendored
@ -7,6 +7,7 @@
|
||||
|
||||
interface KnockoutStatic {
|
||||
track(obj: any, propertyNames?: Array<string>): any;
|
||||
untrack(obj: any, propertyNames?: Array<string>): any;
|
||||
defineProperty(obj: any, propertyName: string, evaluator: Function): any;
|
||||
defineProperty(obj: any, propertyName: string, options: KnockoutDefinePropertyOptions): any;
|
||||
getObservable(obj: any, propertyName: string): KnockoutObservable<any>;
|
||||
@ -26,4 +27,4 @@ interface Array<T> {
|
||||
destroy(item: T): void;
|
||||
destroyAll(items: T[]): void;
|
||||
destroyAll(): void;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user