タグ

asyncとjavascriptに関するbraitomのブックマーク (5)

  • Top-level await · V8

    Top-level await enables developers to use the await keyword outside of async functions. It acts like a big async function causing other modules who import them to wait before they start evaluating their body. The old behavior #When async/await was first introduced, attempting to use an await outside of an async function resulted in a SyntaxError. Many developers utilized immediately-invoked async

    braitom
    braitom 2019/10/13
    ほう。“Top-level await enables developers to use the await keyword outside of async functions. It acts like a big async function causing other modules who import them to wait before they start evaluating their body.”
  • GitHub - sindresorhus/emittery: Simple and modern async event emitter

    You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert

    GitHub - sindresorhus/emittery: Simple and modern async event emitter
    braitom
    braitom 2019/09/23
    シンプルなJavaScriptのAsync event emitterライブラリ。サイズも小さい。
  • Display Locking によるレンダリングの最適化と Async DOM | blog.jxck.io

    Intro React や lit-html などにより、 DOM 操作の抽象化に加えて最適化が提供されることが一般的となった。 見方を変えれば、来ブラウザがやるような最適化を、ライブラリが肩代わりしていると捉えることもできる。 これは、現在の標準 API には、規模が大きく処理が複雑なアプリケーションを開発する際に、足りてないものがあると考えることが可能だ。 課題の 1 つとして「DOM 操作が同期処理である」という点に着目し、 Async DOM という文脈でいくつかの提案が行われた。 今回は、その提案の 1 つであり Chrome で実装が進んでいる Display Locking について現状を解説する。 現状の DOM 操作の課題 まず、以下のような処理を考える。 body.appendChild($div) この処理が JS の途中で出現すれば、その瞬間 Window にある

    Display Locking によるレンダリングの最適化と Async DOM | blog.jxck.io
    braitom
    braitom 2019/06/17
    DOM操作が同期処理であるという問題を解決するためのAsync DOMの提案の中の1つDisplay Lockingについて。現状のDOM操作の問題点、Display Lockingの仕様と実際の動きについて書かれている。
  • Callback を撲滅せよ

    ヤフー株式会社は、2023年10月1日にLINEヤフー株式会社になりました。LINEヤフー株式会社の新しいブログはこちらです。LINEヤフー Tech Blog こんにちは。言語サポート(Node.js)チームの伊藤(@koh110)です。 Node.js v10 も10月にLTSとなり async/await によるフロー制御は当たり前のように利用されるようになってきました。JavaScriptの非同期処理は async/await から覚える人も今後増えていくでしょう。今回はそんな非同期処理について、社内での事例を交えて記事を書いていこうと思います。 index Promise 化がなぜ重要なのか ユーザーに promisify をさせる落とし穴 Road to Promise まとめ Promise 化がなぜ重要なのか ちょうど3年前のアドベントカレンダーで、今後はいろいろなモジュー

    Callback を撲滅せよ
    braitom
    braitom 2019/01/18
    callbackのインターフェイスしか提供されていないJavaScriptライブラリにPromiseのインターフェイスを追加する実装パターンについて。
  • JavaScript async patterns quick guide

    From web applications to servers and mobile apps, from small programs to big projects, JavaScript is everywhere. It's the main choice to embrace any project because, well, it's 2020 and JS is an even more mature language, with an enormous community supporting it. ‍ Writing Asynchronous JavaScriptIn JavaScript, all the code runs synchronously on the event loop, which executes sequentially small chu

    JavaScript async patterns quick guide
    braitom
    braitom 2018/11/15
    JavaScriptの非同期のパターンのまとめ。コールバック、Promise、Generator、Async/wait、非同期を提供するライブラリについてまとめられている。
  • 1