doAfterFactory<TIn, TOut>(f: ((v: TIn) => TOut | Promise<TOut>)): { asyncDoAfter: ((promise: Promise<TIn>) => Promise<TOut>); doAfter: ((x: TIn | Promise<TIn>) => TOut | Promise<TOut>); syncDoAfter: ((value: TIn) => TOut | Promise<TOut>); }
Like doAfter, but remembers whether the sync or the async route should be chosen
based on the first call.
This could speed up things by avoiding repeated isPromise calls.
Like doAfter, but remembers whether the sync or the async route should be chosen based on the first call. This could speed up things by avoiding repeated isPromise calls.
Example
Returns