| title | logoImg | theme | transition | highlightTheme | slideNumber | loop | enableMenu | enableChalkboard |
|---|---|---|---|---|---|---|---|---|
Async Functions |
night |
slide |
monokai |
true |
true |
false |
false |
This chapter should cover the following:
- Async Explaination
- Callback
- Promises
- returned promises
- dealing with rejection
- multiple promises
- Async Await
Async IFFE {.fragment .current-only data-code-focus=1-1} END of Async IFFE {.fragment .current-only data-code-focus=1-1}
(async ()=>{
})()
(async function() {
let responses = [];
responses.push(
await get( urls[0]
)
)
})();Add Try, Catch, Finally {.fragment .current-only data-code-focus=2-10}
Write your code in Try, Catch, Finally {.fragment .current-only data-code-focus=2-10}
Use Catch to handle the errors and reject Promises{.fragment .current-only data-code-focus=2-10}
Then in the Finally block handle {.fragment .current-only data-code-focus=2-10}
Add Try, Catch, Finally {.fragment .current-only data-code-focus=2-10}
(async ()=> {
try {
}
catch (error) {
}
finally {
}
})();