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
Callbags
Search
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Stephan Schneider
May 15, 2018
Programming
78
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Callbags
Introduction to the "callbags" specification for lightweight observables & iterables.
Stephan Schneider
May 15, 2018
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
個人開発者よ、Honoを使え(おじさんver)
tanahiro2010
2
260
[Dev Group Paris Octobre 26] Agentforce, SIforce, Claudeforce, Slackbot… on s'y retrouve ?
nabondance
0
110
Next.js: The final boss of Web Performance
guaca
0
250
TechTown - Creating Composable Callables in Contemporary C++
rollbear
0
130
RAG の “R” を Swift で覗いてみる 〜「意味から探す」検索の仕組み〜
nao_randd
0
160
Starting & Sustaining Code-Based E2E Testing for Non-Coding QA Teams( #jasstniigata )
teyamagu
PRO
1
1k
コードレビューのボトルネックを"する側"と"される側"の両面から解消する
yub0n
2
1.6k
contenteditable と日本語入力に向き合う
colorful12
0
200
FactoryBotをやめればRSpecは速くなるのか?
yuta_onishi_97
0
270
phperだってパンチカードでコーディングしたい
o0h
PRO
0
330
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
220
Domain-Driven Transformation
hschwentner
2
2.3k
Featured
See All Featured
Between Models and Reality
mayunak
4
500
How to Talk to Developers About Accessibility
jct
2
580
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
320
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
360
31k
The Language of Interfaces
destraynor
162
27k
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.8k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Mind Mapping
helmedeiros
1
400
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
35
2.9k
Why You Should Never Use an ORM
jnunemaker
PRO
61
10k
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
2
2.2k
Chasing Engaging Ingredients in Design
codingconduct
0
360
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