UNPKG

@loopback/docs

Version:

Documentation files rendered at [https://loopback.io](https://loopback.io)

78 lines (44 loc) 1.2 kB
--- lang: en title: 'API docs: cron.cronjob' keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI sidebar: lb4_sidebar editurl: https://github.com/loopbackio/loopback-next/tree/master/extensions/cron permalink: /doc/en/lb4/apidocs.cron.cronjob.html --- <!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [@loopback/cron](./cron.md) &gt; [cronJob](./cron.cronjob.md) ## cronJob() function `@cronJob` decorates a cron job provider class **Signature:** ```typescript export declare function cronJob(...specs: BindingSpec[]): ClassDecorator; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td markdown="1"> specs </td><td markdown="1"> [BindingSpec](./context.bindingspec.md)<!-- -->\[\] </td><td markdown="1"> Extra binding specs </td></tr> </tbody></table> **Returns:** ClassDecorator ## Example ```ts @cronJob() class CronJobProvider implements Provider<CronJob> { constructor(@config() private jobConfig: CronJobConfig = {}) {} value() { // ... } } ```