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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
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
2
120
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
240
Module Harmony
petamoriken
3
940
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.6k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
640
ふかぼれ!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
ハーネスエンジニアリングとは?
kinopeee
13
6.3k
10 Tips of AWS ~Gen AI on AWS~
licux
5
480
t *testing.T は どこからやってくるの?
otakakot
1
800
The Monolith Strikes Back: Why AI Agents ❤️ Rails Monoliths
serradura
0
360
運転動画を検索可能にする〜Cosmos-Embed1とDatabricks Vector Searchで〜/cosmos-embed1-databricks-vector-search
studio_graph
1
490
CDK Deployのための ”反響定位”
watany
5
890
SREに優しいTerraform構成 modulesとstateの組み方
hiyanger
2
150
CursorとClaudeCodeとCodexとOpenCodeを実際に比較してみた
terisuke
1
500
PHP で mp3 プレイヤーを実装しよう
m3m0r7
PRO
0
290
〜バイブコーディングを超えて〜 チームで実験し続けたAI駆動開発
tigertora7571
0
170
アーキテクチャモダナイゼーションとは何か
nwiizo
19
5.5k
書籍「ユーザーストーリーマッピング」が私のバイブル
asumikam
4
440
Featured
See All Featured
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
500
We Have a Design System, Now What?
morganepeng
55
8.1k
Evolving SEO for Evolving Search Engines
ryanjones
0
180
Public Speaking Without Barfing On Your Shoes - THAT 2023
reverentgeek
1
380
Prompt Engineering for Job Search
mfonobong
0
280
How to build an LLM SEO readiness audit: a practical framework
nmsamuel
1
730
Introduction to Domain-Driven Design and Collaborative software design
baasie
1
750
GitHub's CSS Performance
jonrohan
1032
470k
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
220
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.6k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
120
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 へ!