Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
DOM Observable
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
petamoriken / 森建
March 15, 2024
Programming
410
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
DOM Observable
福岡フロントエンド勉強会 #1
https://connpass.com/event/311524/
petamoriken / 森建
March 15, 2024
More Decks by petamoriken / 森建
See All by petamoriken / 森建
Security issues being discussed on Web Platforms
petamoriken
0
1.5k
2年かけて Deno に DOMMatrix を実装した話 / How I implemented DOMMatrix in Deno over two years
petamoriken
0
270
WebAssembly を読み込むベストプラクティス 2026年春版 / Best Practices for Loading WebAssembly (Spring 2026)
petamoriken
5
1.3k
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
300
Module Harmony
petamoriken
3
1.2k
Denoでフロントエンド開発 2025年春版 / Frontend Development with Deno (Spring 2025)
petamoriken
1
1.7k
非ブラウザランタイムとWeb標準 / Non-Browser Runtimes and Web Standards
petamoriken
0
700
ふかぼれ!CSSセレクターモジュール / Fukabore! CSS Selectors Module
petamoriken
0
370
フロントエンドの標準仕様をどう追っているか / How I follow the frontend standards specs
petamoriken
4
2.9k
Other Decks in Programming
See All in Programming
SFCで実現する病院・医療システムの動的組み立て式UI
koukimiura
1
170
AIで開発が速くなった先で、開発チームは何を目指すか
shihochan
1
2k
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
1.6k
우리의 Nitro Modules는 당신의 Turbo Modules보다 아름답다
l2hyunwoo
0
260
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
570
Kotlinize Is Not Just Converting to Kotlin
chigichan24
1
220
全ての永続トークンを、生まれる前に消し去りたい!
sylph01
3
1.7k
Будущее локальных LLM – Алексей Голобурдин, PythoNN
sobolevn
0
110
Railsのためのパスキー実践入門 〜マルチテナントSaaSでの意思決定〜
utakaha
4
3.6k
AI-Powered Domain-Driven Design
ziobrando
0
420
小さなアプリを作って公開するまで
onozaty
0
150
Crash Auto Pipelines
veronikapj
1
400
Featured
See All Featured
Un-Boring Meetings
codingconduct
0
490
Into the Great Unknown - MozCon
thekraken
41
2.8k
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
330
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.7k
Git: the NoSQL Database
bkeepers
PRO
433
67k
BBQ
matthewcrist
90
10k
Making the Leap to Tech Lead
cromwellryan
135
10k
From π to Pie charts
rasagy
1
440
Building Applications with DynamoDB
mza
96
7.3k
Raft: Consensus for Rubyists
vanstee
143
7.9k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
128
56k
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 へ!