@sdc-monitor/demo
Version:
<div align="center"> <a href="#" target="_blank"> <img src="https://i.loli.net/2021/07/28/EvPwd4NjVH3tBfO.jpg" alt="mito-logo" height="90"> </a> <p>A Lightweight SDK For Monitor Web</p>
23 lines (19 loc) • 494 B
text/typescript
function log(target, property, descriptor) {
const oldValue = descriptor.value
descriptor.value = function () {
// eslint-disable-next-line prefer-rest-params
console.log(`Calling ${property} with`, arguments)
// eslint-disable-next-line prefer-rest-params
return oldValue.apply(this, arguments)
}
return descriptor
}
class Test {
@log
add(a, b, c) {
return a + b + c
}
}
const math = new Test()
// passed parameters should get logged now
math.add(2, 4, 5)