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
index.ts
and:
  1. Create an OrderStatus enum with the statuses above
  2. Create an order object that uses the enum
  3. 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.

Please set the playground first

Loading "String Enums"
Loading "String Enums"
Login to get access to the exclusive discord channel.
Loading Discord Posts