DisposableStack() constructor
Khả dụng hạn chế
This feature is not Baseline because it does not work in some of the most widely-used browsers.
Constructor DisposableStack() tạo các đối tượng DisposableStack.
Cú pháp
js
new DisposableStack()
Tham số
Không có.
Giá trị trả về
Một đối tượng DisposableStack mới.
Ví dụ
>Tạo một DisposableStack
js
const disposer = new DisposableStack();
disposer.defer(() => console.log("Disposed!"));
disposer.dispose();
// Logs: Disposed!
Đặc tả
| Thông số kỹ thuật |
|---|
| ECMAScript Async Explicit Resource Management> # sec-disposablestack-constructor> |