apiref
ride@2.0.1

ride.after()  Function

Calls the extraBehavior after the original function has been called.

Signature

function after<T, A extends any[], R>(extraBehavior: (this: T, ...args: A) => void): Decorator<T, (this: T, ...args: A) => R>;

Remarks

If the original function throws an error, the extraBehavior will NOT be called.

Example

ride(test, 'saveResults', ride.after(savePlan))

Parameters

ParameterTypeDescription
extraBehavior(this: T, ...args: A) => void

The function to call after the original function returned.

(Returns)Decorator<T, (this: T, ...args: A) => R>