You will need NPM and nvm on your computer to study this material
Using a browser with good DevTools will make your life easier: Chromium, FireFox, Edge, Chrome
- Install or update the
study-lenses
package globallynpm install -g study-lenses
(if you do not have it already)npm update -g study-lenses
(if you already have it installed)
- Clone this repository:
git clone git@github.com:HackYourFutureBelgium/asynchronous-programming.git
(SSH) (recommended)git clone https://github.com/HackYourFutureBelgium/asynchronous-programming.git
(HTTPS)gh repo clone HackYourFutureBelgium/asynchronous-programming
(GH CLI)
cd
into the repositorycd asynchronous-programming
- Run the
study
command from your CLIstudy
- The material will open in your default browser, you're good to go!
If you have a windows computer and get this error:
... /study.ps1 cannot be loaded because running scripts ...
follow the instructions in this StackOverflow answer, that should take care of it ; )
In this exercise we are going to emulate a restaurant that makes meals based on the preferences of the guests.
Every meal needs to go through the following steps:
- Select a size and a base to prepare the meal
- Add the vegetables to the portion
- select and add the topping
- pick and add the sauce
- add the previously prepared extra's to the meal
- bag the finished meal
And every step can only be started after the previous step has finished. Two separate meals can however be prepared at the same time.
Also important to note is that all extra's need to be prepared before they can be added to the meal. The preparation of these extra's can be done in parallel to the preparation of the meals themselves.
Inside the kitchen/steps.js files you can find exported functions for every step of the preparation process. The required values for the ingredients can be found in the kitchen/ingredients.js file.
Examples on how to use the files can be found in the example.js files in the 1-simple-orders, 2-with-extras and 3-multiple-dishes directories. Based on these examples try to complete the exercises in these directories.