F

after

Runs a callback after a method, which can replace its result by returning a value.

function after<M extends PatchParent, P extends string>(parent: M, method: P, callback: AfterCallback<ArgsOf<M[P]>, ResultOf<M[P]>, SelfOf<M, M[P]>>, options?: PatchOptions): () => void

Parameters

NameTypeDescription
parentM

The object holding the method.

methodP

The method's key.

callbackAfterCallback<ArgsOf<M[P]>, ResultOf<M[P]>, SelfOf<M, M[P]>>

Receives the patch context.

options?PatchOptions

Patch options.

Returns

() => void

A function removing the patch.