$30 off During Our Annual Pro Sale. View Details »
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
DOM Observable
Search
petamoriken / 森建
March 15, 2024
Programming
1
300
DOM Observable
福岡フロントエンド勉強会 #1
https://connpass.com/event/311524/
petamoriken / 森建
March 15, 2024
Tweet
Share
More Decks by petamoriken / 森建
See All by petamoriken / 森建
Module Harmony
petamoriken
2
680
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.5k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
590
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
280
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
4
2.5k
ECMAScript、Web標準の型はどう管理されているか / How ECMAScript and Web standards types are maintained
petamoriken
3
600
Deno に Web 標準 API を実装する / Implementing Web standards API to Deno
petamoriken
0
730
Contributing to Deno is fun!
petamoriken
0
410
Stage 2 Decorators の変遷 / Stage 2 Decorators history
petamoriken
0
7.2k
Other Decks in Programming
See All in Programming
ELYZA_Findy AI Engineering Summit登壇資料_AIコーディング時代に「ちゃんと」やること_toB LLMプロダクト開発舞台裏_20251216
elyza
2
430
re:Invent 2025 のイケてるサービスを紹介する
maroon1st
0
140
AIエンジニアリングのご紹介 / Introduction to AI Engineering
rkaga
8
3.2k
AI時代を生き抜く 新卒エンジニアの生きる道
coconala_engineer
1
370
C-Shared Buildで突破するAI Agent バックテストの壁
po3rin
0
410
TestingOsaka6_Ozono
o3
0
170
Developing static sites with Ruby
okuramasafumi
0
310
ゆくKotlin くるRust
exoego
1
130
Kotlin Multiplatform Meetup - Compose Multiplatform 외부 의존성 아키텍처 설계부터 운영까지
wisemuji
0
110
ローターアクトEクラブ アメリカンナイト:川端 柚菜 氏(Japan O.K. ローターアクトEクラブ 会長):2720 Japan O.K. ロータリーEクラブ2025年12月1日卓話
2720japanoke
0
740
モデル駆動設計をやってみようワークショップ開催報告(Modeling Forum2025) / model driven design workshop report
haru860
0
280
ViewファーストなRailsアプリ開発のたのしさ
sugiwe
0
510
Featured
See All Featured
Faster Mobile Websites
deanohume
310
31k
Joys of Absence: A Defence of Solitary Play
codingconduct
1
250
Writing Fast Ruby
sferik
630
62k
Designing for Performance
lara
610
69k
Getting science done with accelerated Python computing platforms
jacobtomlinson
0
73
How Software Deployment tools have changed in the past 20 years
geshan
0
29k
Visualization
eitanlees
150
16k
SEO for Brand Visibility & Recognition
aleyda
0
4.1k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
110
What the history of the web can teach us about the future of AI
inesmontani
PRO
0
370
How to Talk to Developers About Accessibility
jct
1
81
How STYLIGHT went responsive
nonsquared
100
6k
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 へ!