Skip to content

Commit d03c176

Browse files
committed
docs: use typescript fence token instead of ts in overview.mdx
1 parent 894109d commit d03c176

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/tasks/overview.mdx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ See our [maxDuration guide](/runs/max-duration) for more information.
142142

143143
You can register global lifecycle hooks that are executed for all runs, regardless of the task. While you can still define these in the `trigger.config.ts` file, you can also register them anywhere in your codebase:
144144

145-
```ts
145+
```typescript
146146
import { tasks } from "@trigger.dev/sdk";
147147

148148
tasks.onStart(({ ctx, payload, task }) => {
@@ -236,7 +236,7 @@ tasks.onResume("db", async ({ ctx, payload, task }) => {
236236

237237
You can access the database client using `getDb()` in your tasks `run` function and all your hooks (global or task specific):
238238

239-
```ts
239+
```typescript
240240
import { getDb } from "./db";
241241

242242
export const myTask = task({
@@ -251,7 +251,7 @@ export const myTask = task({
251251

252252
You can also define middleware per task by passing the `middleware` option in the task definition. This runs after global middleware and before the `run` function. Use it when only specific tasks need certain locals or setup:
253253

254-
```ts
254+
```typescript
255255
import { task, locals } from "@trigger.dev/sdk";
256256

257257
const myLocal = locals.create<string>("myLocal");
@@ -319,7 +319,7 @@ export const taskWithOnStartAttempt = task({
319319

320320
These lifecycle hooks allow you to run code when a run is paused or resumed because of a wait:
321321

322-
```ts
322+
```typescript
323323
export const myTask = task({
324324
id: "my-task",
325325
onWait: async ({ wait }) => {
@@ -462,15 +462,15 @@ Read more about `catchError` in our [Errors and Retrying guide](/errors-retrying
462462
463463
You can define an `onCancel` hook that is called when a run is cancelled. This is useful if you want to clean up any resources that were allocated for the run.
464464
465-
```ts
465+
```typescript
466466
tasks.onCancel(({ ctx, signal }) => {
467467
console.log("Run cancelled", signal);
468468
});
469469
```
470470
471471
You can use the `onCancel` hook along with the `signal` passed into the run function to interrupt a call to an external service, for example using the [streamText](https://ai-sdk.dev/docs/reference/ai-sdk-core/stream-text) function from the AI SDK:
472472
473-
```ts
473+
```typescript
474474
import { logger, tasks, schemaTask } from "@trigger.dev/sdk";
475475
import { streamText } from "ai";
476476
import { z } from "zod";
@@ -524,7 +524,7 @@ export const interruptibleChat = schemaTask({
524524
525525
The `onCancel` hook can optionally wait for the `run` function to finish, and access the output of the run:
526526
527-
```ts
527+
```typescript
528528
import { logger, task } from "@trigger.dev/sdk";
529529
import { setTimeout } from "node:timers/promises";
530530

0 commit comments

Comments
 (0)