UNPKG

@naturalcycles/js-lib

Version:

Standard library for universal (browser + Node.js) javascript

11 lines (9 loc) 340 B
import type { PRetryOptions } from '../promise/pRetry.js' import { pRetryFn } from '../promise/pRetry.js' export function _Retry(opt: PRetryOptions = {}): MethodDecorator { return (_target, _key, descriptor) => { const originalFn = descriptor.value descriptor.value = pRetryFn(originalFn as any, opt) return descriptor } }