Skip to content
This repository was archived by the owner on Jan 25, 2022. It is now read-only.

Commit 60d2a78

Browse files
author
Daniel Ehrenberg
authored
Remove cleanupSome documentation
As it has been split into a separate proposal
1 parent 83cd4bd commit 60d2a78

1 file changed

Lines changed: 0 additions & 28 deletions

File tree

reference.md

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ A finalization registry provides a way to request that a *cleanup callback* get
113113
* [The `FinalizationRegistry` Constructor](#the-finalizationregistry-constructor)
114114
* [`FinalizationRegistry.prototype.register`](#finalizationregistryprototyperegister)
115115
* [`FinalizationRegistry.prototype.unregister`](#finalizationregistryprototypeunregister)
116-
* [`FinalizationRegistry.prototype.cleanupSome`](#finalizationregistryprototypecleanupsome) *(optional)*
117116

118117
## FinalizationRegistry Overview
119118

@@ -322,33 +321,6 @@ class Thingy {
322321
}
323322
```
324323

325-
### `FinalizationRegistry.prototype.cleanupSome`
326-
327-
This **optional** method triggers callbacks for an implementation-chosen number of objects in the registry that have been reclaimed but whose callbacks have not yet been called:
328-
329-
```js
330-
registry.cleanupSome?.(heldValue => {
331-
// ...
332-
});
333-
```
334-
335-
This method is optional, any given implementation may not have it. It's expected not to be present on web browsers, at least not initially; see [HTML issue #5446](https://github.com/whatwg/html/issues/5446) for details. Since the method is optional, you need to check that it's there before calling it. One way to do that is to use [optional chaining](https://github.com/tc39/proposal-optional-chaining) (`?.`) as in the example above.
336-
337-
Normally, you don't call this function. Leave it to the JavaScript engine's garbage collector to do the callbacks as appropriate. This function primarily exists to support long-running code which doesn't yield to the event loop, which is more likely to come up in WebAssembly than ordinary JavaScript code. Also note that the callback may not be called (for instance, if there are no registry entries whose targets have been reclaimed).
338-
339-
**Parameters**
340-
341-
* `callback` - (Optional) If given, the registry uses the given callback instead of the one it was created with. It must be callable.
342-
343-
**Returns**
344-
345-
* *(none)*
346-
347-
**Notes**
348-
349-
* The number of entries for reclaimed objects that are cleaned up from the registry (calling the cleanup callbacks) is implementation-defined. An implementation might remove just one eligible entry, or all eligible entries, or somewhere in between.
350-
351-
352324
<!-- for scrolling to links near the end -->
353325
<br>
354326
<br>

0 commit comments

Comments
 (0)