Observe any object's method calls
npm i -S rx-fn-observe
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.