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
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
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
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
160
ThorVG Viewer In VS Code
nors
0
770
Fragmented Architectures
denyspoltorak
0
150
KIKI_MBSD Cybersecurity Challenges 2025
ikema
0
1.3k
なるべく楽してバックエンドに型をつけたい!(楽とは言ってない)
hibiki_cube
0
140
Honoを使ったリモートMCPサーバでAIツールとの連携を加速させる!
tosuri13
1
180
AIと一緒にレガシーに向き合ってみた
nyafunta9858
0
200
Fluid Templating in TYPO3 14
s2b
0
130
【卒業研究】会話ログ分析によるユーザーごとの関心に応じた話題提案手法
momok47
0
190
フロントエンド開発の勘所 -複数事業を経験して見えた判断軸の違い-
heimusu
7
2.8k
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
Oxlintはいいぞ
yug1224
5
1.3k
Featured
See All Featured
How to Talk to Developers About Accessibility
jct
2
130
Faster Mobile Websites
deanohume
310
31k
Why You Should Never Use an ORM
jnunemaker
PRO
61
9.7k
Information Architects: The Missing Link in Design Systems
soysaucechin
0
770
It's Worth the Effort
3n
188
29k
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
410
We Have a Design System, Now What?
morganepeng
54
8k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.6k
The Power of CSS Pseudo Elements
geoffreycrofte
80
6.2k
How to Think Like a Performance Engineer
csswizardry
28
2.4k
Designing for humans not robots
tammielis
254
26k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
79
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