akameco / call-proxy

call proxy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

call-proxy

Build Status tested with jest styled with prettier All Contributors

call proxy

Install

$ yarn add call-proxy

Usage

const callProxy = require('call-proxy')

let i = 0
const hello = () => `hello ${++i}`
const x = callProxy(hello)

x() // => hello 1
x() // => hello 2
x() // => hello 3

console.log(x.__times__)
// => 3

console.log(x.__calls__)
// [ 'hello 1', 'hello 2', 'hello 3' } ]

API

loggerProxy(func)

func

Type: function

target function.

__times__

__calls__

Contributors

Thanks goes to these wonderful people (emoji key):


akameco

💻 📖 ⚠️ 🚇

This project follows the all-contributors specification. Contributions of any kind welcome!

License

MIT © akameco

About

call proxy

License:MIT License


Languages

Language:JavaScript 100.0%