-
Notifications
You must be signed in to change notification settings - Fork 0
Typing Pizza App part 9
So far in our code, the ids for new menu items need to be passed manually. We are now going to work into refactoring our code, so when we add a new pizza we can pass to our addPizza function a partial pizza object with no id and let our code to generate that automacically for us.
This change can be easly done if we use the same concecpt / idea we used when creating the order ids.
Important things to notice:
- After making the changes on the code, new TypeScript warnings may appear:
- Some of those warnings can be fixed already by placing some variable declarations in the correct position inside the code
- Other warning will be fixed later with some new concepts yet to be covered in future lectures
Those notes were written while watching the tutorial videos while taking the classes from the online course Learn TypeScript on Scrimba.
Because english is not my mother language, they can contain some typos and everything written here is based on my understanding about the discussed topics and may not be 100% accurate.
If you want the full course, support the instructor by buying their course on Scrimba.
- Home
- Introduction
- Introduction to TypeScript
- The Pizza Application
- Move to TypeScript
- Defensive Coding
- Typing variables
- Typing Pizza App: part 1
- Custom types
- Typing Pizza App: part 2
- Nested Object types
- Optional Properties
- Typing Pizza App: part 3
- Array Types
- Typing Pizza App: part 4
- Literal Types
- Unions
- Typing Pizza App: part 5
- Typing Pizza App: part 6
- Typing Pizza App: part 7
- Returning Types
- Typing Pizza App: part 8
- Any Type
- Typing Pizza App: part 9
- Utility Types
- Typing Pizza App: part 10
- Generics
- Typing Pizza App: part 11