rx-fn-observe
v0.0.2
Published
Observe any object's method calls
Downloads
2
Maintainers
Readme
rx-fn-observe
Observe any object's method calls
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.