Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DOM Observable
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
petamoriken / 森建
March 15, 2024
Programming
350
1
Share
DOM Observable
福岡フロントエンド勉強会 #1
https://connpass.com/event/311524/
petamoriken / 森建
March 15, 2024
More Decks by petamoriken / 森建
See All by petamoriken / 森建
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.1k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
240
Module Harmony
petamoriken
3
950
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.6k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
650
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
320
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
4
2.7k
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
650
Deno に Web 標準 API を実装する / Implementing Web standards API to Deno
petamoriken
0
810
Other Decks in Programming
See All in Programming
Back to the roots of date
jinroq
0
700
AI-DLC Deep Dive
yuukiyo
9
5.6k
cloudnative conference 2026 flyle
azihsoyn
0
100
ソースコード→AST→オペコード、の旅を覗いてみる
o0h
PRO
1
120
Terraform言語の静的解析 / static analysis of Terraform language
wata727
1
140
when storing skills in S3 file
watany
3
1.2k
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
120
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
360
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
480
「Linuxサーバー構築標準教科書」を読んでみた #ツナギメオフライン.7
akase244
0
1.4k
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
170
Cache-moi si tu peux : patterns et pièges du cache en production - Devoxx France 2026 - Conférence
slecache
0
330
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
28
2.6k
Building the Perfect Custom Keyboard
takai
2
750
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Unsuck your backbone
ammeep
672
58k
Designing for Timeless Needs
cassininazir
0
220
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
410
Testing 201, or: Great Expectations
jmmastey
46
8.1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
340
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
280
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
500
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
530
Transcript
DOM Observable 福岡フロントエンド勉強会 #1 pixiv Inc. 森内建太 petamoriken 2024.3.15
2 自己紹介 • Web エンジニア • ECMAScript や WHATWG を追うのが好き • 最近 Float16Array が SpiderMonkey, V8 に入った! petamoriken
カスタマーオペレーション &セーフティ本部 オペレーション開発部
3 目次 • JavaScript におけるストリーム • Observable とは • DOM Observable の提案 •
RxJS との違い • 細かい話
4 JavaScript におけるストリーム • Pull ストリーム ◦ Iterator, AsyncIterator (ECMAScript) ◦ ReadableStream
(Streams Standard) • Push ストリーム ◦ EventTarget (DOM Standard) ▪ 一応ストリームとして扱えるがどちらかといえばイベント
5 Observable とは • Push ストリームのライブラリ実装 ◦ JS だと RxJS が一番有名
6 DOM Observable の提案 • TC39 の方で標準化を進めていたが5年くらい音沙汰がなかった • RxJS コアチームリードの Ben Lesh さんが Web 側で標準化する提案を出した
7 DOM Observable の提案
8 RxJS との違い • RxJS の Hot Observable を作る機能はない • クリーンアップの処理のコールバックの渡し方が違う • RxJS は fromEvent 函数で変換するが、直接 EventTarget にメソッドが生える ◦
EventTarget#on が提案されていたが Break the Web で駄目 😭 ◦ EventTarget#observe は IntersectionObserver 等と型が違うから微妙
9 細かい話 • Observable#subscribe のコールバックは同期的に実行される ◦ Promise#then や await ではマイクロタスクになるため非同期になる ◦ Observable を非同期にしちゃうと Event#preventDefault が呼べなくなっちゃう 👉 Promise に変換するときに要注意!
10 詳しくは Zenn へ!