Skip to content

Commit

Permalink
Fix context data docs (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
AdrianMachado authored Dec 22, 2023
1 parent bf274ab commit 58530bb
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

1 comment on commit 58530bb

@vercel
Copy link

@vercel vercel bot commented on 58530bb Dec 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

docs – ./

docs.zuplopreview.net
docs-git-main.zuplopreview.net
docs.zuplo.site

Please sign in to comment.