0.0.1 • Published 4 years ago

@decoro/log-on-call v0.0.1

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

@decoro/log-on-call

npm version npm download monthly npm download total npm dependents npm license pp install size github commit last github commit total

//: <> (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

LICENSE (MIT)