You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/utilities/idempotency.md
+4-1Lines changed: 4 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ After processing this request successfully, a second request containing the exac
139
139
See [Choosing a payload subset for idempotency](#choosing-a-payload-subset-for-idempotency) for more elaborate use cases.
140
140
141
141
142
-
You can also use the `makeIdempotent` function wrapper on any function that returns a response to make it idempotent. This is useful when you want to make a specific logic idempotent, for example when your Lambda handler performs multiple side effects and you only want to make a specific one idempotent.
142
+
You can also use the `makeIdempotent` function wrapper on any method that returns a response to make it idempotent. This is useful when you want to make a specific logic idempotent, for example when your Lambda handler performs multiple side effects and you only want to make a specific one idempotent.
143
143
144
144
???+ warning "Limitation"
145
145
Make sure to return a JSON serializable response from your function, otherwise you'll get an error.
@@ -173,6 +173,9 @@ You can also use the `@idempotent` decorator to make your Lambda handler idempot
173
173
=== "types.ts"
174
174
175
175
```typescript
176
+
--8<-- "docs/snippets/idempotency/types.ts"
177
+
```
178
+
176
179
177
180
You can use the decorator on your Lambda handler or on any function that returns a response to make it idempotent. This is useful when you want to make a specific logic idempotent, for example when your Lambda handler performs multiple side effects and you only want to make a specific one idempotent.
178
181
The configuration options for the `@idempotent` decorator are the same as the ones for the `makeIdempotent` function wrapper.
Copy file name to clipboardExpand all lines: packages/idempotency/README.md
+10-10Lines changed: 10 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ You can use the package in both TypeScript and JavaScript code bases.
25
25
## Intro
26
26
27
27
This package provides a utility to implement idempotency in your Lambda functions.
28
-
You can either use it to wrap a function, decorate a function, or as Middy middleware to make your AWS Lambda handler idempotent.
28
+
You can either use it to wrap a function, decorate a method, or as Middy middleware to make your AWS Lambda handler idempotent.
29
29
30
30
The current implementation provides a persistence layer for Amazon DynamoDB, which offers a variety of configuration options. You can also bring your own persistence layer by extending the `BasePersistenceLayer` class.
31
31
@@ -181,8 +181,8 @@ const persistenceStore = new DynamoDBPersistenceLayer({
0 commit comments