0.0.2 • Published 6 years ago

rx-fn-observe v0.0.2

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

rx-fn-observe

Observe any object's method calls

NPM Version

Install

npm i -S rx-fn-observe

API

The API provides two functions to observe calls to methods. Both expect an object and the name of the function to observe.

observeArguments<T, K extends keyof T>(object: T, method: K): Observable<ArgumentList<T[K]>>

Emits the argument list passed to the method before the function body executes.

observeReturnValue<T, K extends keyof T>(object: T, method: K): Observable<ReturnType<T[K]>>

Emits the return value of the method after the function body has been executed.

License

ISC