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
Callbags
Search
Stephan Schneider
May 15, 2018
Programming
0
73
Callbags
Introduction to the "callbags" specification for lightweight observables & iterables.
Stephan Schneider
May 15, 2018
Tweet
Share
More Decks by Stephan Schneider
See All by Stephan Schneider
Dynamic Schema Generation for Changing Data Models
zcei
0
140
Observables - Streams on steroids
zcei
0
170
Other Decks in Programming
See All in Programming
Spinner 軸ズレ現象を調べたらレンダリング深淵に飲まれた #レバテックMeetup
bengo4com
1
230
プロダクトオーナーから見たSOC2 _SOC2ゆるミートアップ#2
kekekenta
0
200
組織で育むオブザーバビリティ
ryota_hnk
0
170
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
260
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
CSC307 Lecture 09
javiergs
PRO
1
830
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
550
16年目のピクシブ百科事典を支える最新の技術基盤 / The Modern Tech Stack Powering Pixiv Encyclopedia in its 16th Year
ahuglajbclajep
5
1k
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
270
React 19でつくる「気持ちいいUI」- 楽観的UIのすすめ
himorishige
11
7.3k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
670
例外処理とどう使い分ける?Result型を使ったエラー設計 #burikaigi
kajitack
16
6k
Featured
See All Featured
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
150
Color Theory Basics | Prateek | Gurzu
gurzu
0
200
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
160
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
32
2.1k
[SF Ruby Conf 2025] Rails X
palkan
1
740
Building Flexible Design Systems
yeseniaperezcruz
330
40k
For a Future-Friendly Web
brad_frost
182
10k
SEOcharity - Dark patterns in SEO and UX: How to avoid them and build a more ethical web
sarafernandez
0
120
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
140
Max Prin - Stacking Signals: How International SEO Comes Together (And Falls Apart)
techseoconnect
PRO
0
84
Claude Code のすすめ
schroneko
67
210k
AI: The stuff that nobody shows you
jnunemaker
PRO
2
250
Transcript
Callbags BY STEPHAN SCHNEIDER
“Didn’t you mean ‘callbacks’” Literally everyone I told about this
talk
What are callbags? • a contract how callbacks work in
their context • similar to Node's error-first convention // error-first fs.readFile('/path/to/file', (err, data) => { ... }) // callbag source(0, (type, data) => { ... })
Generality Promise Observable Callbag Function Where does it stand?
Predictability Promise Observable Callbag Function Where does it stand?
The specification https://github.com/callbag/callbag
Sources - produces data Terms → Sinks - consumes data
→ Operators - takes a source, returns a source →
(type: number, payload?: any) => void
“End” - terminate the callbag “Start” - sent & received
once as part of the handshake Design Principles 0 2 Type 1 “Data” - deliver data to the callbag
• Call source with type === 0 • Callback is
greeted back with type === 0 • “Talkback” allows sending data to source Handshake
• type === 2 • Without second parameter: success •
Anything truthy as second parameter: error Termination
• type === 1 • Only after handshake • Only
before termination Data Delivery
“A standard for JS callbacks that enables lightweight observables and
iterables”
Let’s have a look at the code
• No central implementation • Anything that sticks to the
interface is considered a callback • There’s no official standard lib • Everyone is invited to become an operator maintainer Governance
Further reading • Spec: https://github.com/callbag/callbag • Comparison to RxJS: https://egghead.io/articles/comparing-callba
gs-to-rxjs-for-reactive-programming
Further reading • Wiki: https://github.com/callbag/callbag/wiki (contains a list of available
utility packages) • Toolkit of commonly used operators: https://github.com/staltz/callbag-basics