Logo
    Search

    asynchronous programming

    Explore "asynchronous programming" with insightful episodes like "Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!" and "Async + Await" from podcasts like ""Syntax - Tasty Web Development Treats" and "Syntax - Tasty Web Development Treats"" and more!

    Episodes (2)

    Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!

    Hasty Treat - Seven Interesting JavaScript Proposals - Async Do, JSON Modules, Immutable Array Methods, and More!

    In this Hasty Treat, Scott and Wes talk about seven new JavaScript proposals — what they do, where they’re at, and how you might use them.

    Deque - Sponsor

    Deque’s axe DevTools makes accessibility testing easy and doesn’t require special expertise. Find and fix issues while you code. Get started with a free trial of axe DevTools Pro at deque.com/syntax. No credit card needed.

    LogRocket - Sponsor

    LogRocket lets you replay what users do on your site, helping you reproduce bugs and fix issues faster. It’s an exception tracker, a session re-player and a performance monitor. Get 14 days free at logrocket.com/syntax.

    Show Notes

    03:32 - Seven new JavaScript proposals

    06:25 - JSON Modules

    09:55 - Array Find From Last

    11:40 - Async Do

    • https://github.com/tc39/proposal-async-do-expressions
    • Async do will allow you to group together a block of code and mark it as async.
    • No need for an iife
    • Downside to this is that it’s a code block, so if you need to return any values, you’ll need to jump that up a scope level.
     Promise.all([   async do {     let result = await fetch('thing A');     await result.json();   },   async do {     let result = await fetch('thing B');     await result.json();   }, ]).then(([a, b]) => console.log([a, b]));  

    14:33 - Change Array By Copy

    17:48 - Temporal

    18:35 - As Patterns

    20:47 - Pattern Matching

        {props => match (props) {     when ({ loading }) { ; }     when ({ error }) { ; }     when ({ data }) { ; }   }}   

    Tweet us your tasty treats!

    Async + Await

    Async + Await

    Freshbooks — Sponsor

    If you are a small business or freelancer check out Freshbooks.com Cloud Accountingand get 30 days free. Make sure to enter SYNTAX into the "How did you hear about us" section.

    Show Notes

    02:55

    06:00

    • Callback Hell
    • Q
    • Bluebird
    • What is a promise?
    • Promises are an IOU

    8:30

    • Async + Await IS promises
    • What is Async + Await?
    • How does the code look?
    • Returning values from an await

    15:20

    • Performance Considerations
    • MEGA PROMISES
    • Promise.all()
    • Here is an example:
    • const [weather, store] = Promise.all(getWeather(), getStores());

    19:22

    22:48

    27:00

    • Snackisodes
    • Snack Packs
    • Hasty Treats?!!!

    28:00

    30:00

    • Error Handling Methods
    • View my slides for some code examples.
    • Try/Catch
    • High Order Function
    • Just handle the error when you callIt().catch(dealWithIt);
    • Node's process.on('unhandledRejection') event

    36:00

    • Browser Support
    • Babel it!

    38:00

    SIIIIICK PICKS

    42:00

    47:00

    • Sick Tip
    • Chrome's Autoplay is changing
    • Details on this
    • Visit chrome://media-engagement to see your scores

    Shameless Plugs

    Tweet us your tasty treats!