Skip to content

Commit

Permalink
Fix context data docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianMachado committed Dec 21, 2023
1 parent ce34bb1 commit 9b8eb8c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions docs/articles/context-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const data = myData.get(context);

### Typing

The methods of `CustomData` support generics in order to support typing.
The methods of `ContextData` support generics in order to support typing.

```ts
const myData = new ContextData<{ key: string }>("my-data");
Expand Down Expand Up @@ -91,10 +91,10 @@ throughout the lifecycle of a request.
### Using static methods

```ts
import { CustomData, ZuploContext, ZuploRequest } from "@zuplo/runtime";
import { ContextData, ZuploContext, ZuploRequest } from "@zuplo/runtime";

export function myFirstPolicy(request: ZuploRequest, context: ZuploContext) {
CustomData.set(context, "currentRequestId", context.requestId;
ContextData.set(context, "currentRequestId", context.requestId);

const currentRequestId = ContextData.get(context, "currentRequestId");
context.log.info(`The current requestId is: ${currentRequestId}`);
Expand Down

0 comments on commit 9b8eb8c

Please sign in to comment.