0.0.1 • Published 4 years ago
@decoro/log-on-call v0.0.1
@decoro/log-on-call
//: <> (Shields)
//: <> (Link)
Enums of signals
Install
$ npm install @decoro/log-on-call
Usage
import { LogOnCall } from '@decoro/log-on-call'
const logOnCall = LogOnCall('decorator:logger')
class Point {
constructor(x, y) { this.x = x; this.y = y }
@logOnCall
get distance() { return Math.sqrt(this.x ** 2 + this.y ** 2) }
}
const p = new Point(3, 4)
p.distance |> console.log
// console outputs:
// > [decorator:logOnCall] 18:29:49.008 calling property Point.distance
// > 10
Meta
0.0.1
4 years ago