@lynx-js/web-core
Version:
This is an internal experimental package, do not use
12 lines • 547 B
JavaScript
// Copyright 2023 The Lynx Authors. All rights reserved.
// Licensed under the Apache License Version 2.0 that can be found in the
// LICENSE file in the root directory of this source tree.
export function createJSObjectDestructionObserver() {
const registry = new FinalizationRegistry((callback) => callback());
return (cleanupCallback) => {
const observedObject = {};
registry.register(observedObject, cleanupCallback);
return observedObject;
};
}
//# sourceMappingURL=createJSObjectDestructionObserver.js.map