Skip to content

Commit 54f2c30

Browse files
authored
Update doc/contributing/erm-guidelines.md
1 parent d5d73be commit 54f2c30

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

doc/contributing/erm-guidelines.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,15 @@ Or even fully anonymous objects:
169169

170170
```js
171171
function getDisposable() {
172+
let disposed = false;
172173
return {
173-
[Symbol.dispose]() {
174+
dispose() {
175+
if (disposed) return;
176+
diposed = true;
174177
console.log('Resource disposed');
178+
}
179+
[Symbol.dispose]() {
180+
this.dispose();
175181
},
176182
};
177183
}

0 commit comments

Comments
 (0)