apiref
ride@2.0.1

ride()  Function

Overrides a method named methodName on the object with the result from calling the callback function with the original method.

Signature

export declare function ride<T extends object, K extends keyof T>(object: T, methodName: K, decorator: Decorator<T, T[K]>): void;

Parameters

ParameterTypeDescription
objectT

The object with the method that you want to override.

methodNameK

The name of the method to override.

decoratorDecorator<T, T[K]>

The function that should return the overridden method.

(Returns)void