Throttle `$plugin` deprecation warning

Signed-off-by: Phillip Rak <rak.phillip@gmail.com>
This commit is contained in:
Phillip Rak 2025-09-16 08:38:11 -07:00
parent e84cfd0260
commit 395be480e7
1 changed files with 7 additions and 2 deletions

View File

@ -1,3 +1,4 @@
import { throttle } from 'lodash';
import { initExtensionManager } from './extension-manager-impl';
export default function(context, inject) {
@ -17,10 +18,14 @@ export default function(context, inject) {
* accessed
*/
const deprecationProxy = (target, message) => {
const logWarning = throttle(() => {
// eslint-disable-next-line no-console
console.warn(message);
}, 150);
const deprecationHandler = {
get(target, prop) {
// eslint-disable-next-line no-console
console.warn(message);
logWarning();
return Reflect.get(target, prop);
}