Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions aws-lambda-durable-functions-power/steering/advanced-patterns.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,12 +247,10 @@ import {
} from '@aws/durable-execution-sdk-js';

class User {
constructor(
public name: string,
public email: string,
public createdAt: Date,
public updatedAt: Date
) {}
name: string = '';
email: string = '';
createdAt: Date = new Date();
updatedAt: Date = new Date();
}

const result = await context.step(
Expand All @@ -275,19 +273,19 @@ console.log(result.createdAt instanceof Date); // true
import { createClassSerdes } from '@aws/durable-execution-sdk-js';

class Order {
constructor(
public id: string,
public items: OrderItem[],
public customer: Customer
) {}
id: string = '';
items: OrderItem[] = [];
customer: Customer = new Customer();
}

class OrderItem {
constructor(public sku: string, public quantity: number) {}
sku: string = '';
quantity: number = 0;
}

class Customer {
constructor(public id: string, public name: string) {}
id: string = '';
name: string = '';
}

// Create serdes for each class
Expand Down