String Enums
String Enums
π¨βπΌ We're building an order management system. Orders go through different
statuses, and we want type-safe status values.
enum OrderStatus {
Pending = 'pending',
Processing = 'processing',
Shipped = 'shipped',
Delivered = 'delivered',
}
π¨ Open
and:
- Create an
OrderStatusenum with the statuses above - Create an order object that uses the enum
- Create a function that handles each status
If you see an "experimental transform-types" warning when running this step,
that's from the workshop runtime and can be ignored.