in src/AutoSubscriptions.ts [158:167]
export function enableAutoSubscribe(handler: AutoSubscribeHandler): MethodDecorator {
return <T>(target: InstanceTarget, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => {
// Note: T might have other properties (e.g. T = { (): void; bar: number; }). We don't support that and need a cast/assert.
const existingMethod = descriptor.value as any as Function;
assert(isFunction(existingMethod), 'Can only use @enableAutoSubscribe on methods');
descriptor.value = enableAutoSubscribeWrapper(handler, existingMethod, undefined) as any as T;
return descriptor;
};
}