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
Streams no Javascript
Search
Sponsored
·
Ship Features Fearlessly
Turn features on and off without deploys. Used by thousands of Ruby developers.
→
Lucas Santos
November 28, 2018
Programming
0
98
Streams no Javascript
Palestra sobre o uso de streams no Javascript
Lucas Santos
November 28, 2018
Tweet
Share
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
100
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
61
TypeScript tips that could save your life
khaosdoctor
0
220
É hora de falar sobre Deno
khaosdoctor
0
77
JS Software testing for beginners
khaosdoctor
0
87
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
42
The Dark Side of JavaScript
khaosdoctor
0
80
Integrating Containers Into JavaScript
khaosdoctor
0
70
Other Decks in Programming
See All in Programming
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
責任感のあるCloudWatchアラームを設計しよう
akihisaikeda
3
160
AI Agent の開発と運用を支える Durable Execution #AgentsInProd
izumin5210
7
2.3k
dchart: charts from deck markup
ajstarks
3
990
AI前提で考えるiOSアプリのモダナイズ設計
yuukiw00w
0
220
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
コマンドとリード間の連携に対する脅威分析フレームワーク
pandayumi
1
450
組織で育むオブザーバビリティ
ryota_hnk
0
170
[KNOTS 2026登壇資料]AIで拡張‧交差する プロダクト開発のプロセス および携わるメンバーの役割
hisatake
0
250
生成AIを使ったコードレビューで定性的に品質カバー
chiilog
1
240
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
Featured
See All Featured
Digital Projects Gone Horribly Wrong (And the UX Pros Who Still Save the Day) - Dean Schuster
uxyall
0
300
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
120
Why Your Marketing Sucks and What You Can Do About It - Sophie Logan
marketingsoph
0
72
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Build The Right Thing And Hit Your Dates
maggiecrowley
38
3k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.8k
30 Presentation Tips
portentint
PRO
1
210
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
162
16k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
1
49
What does AI have to do with Human Rights?
axbom
PRO
0
2k
Transcript
Streams no JavaScript O que são? O que comem? Onde
Vivem?
$ whoami Lucas Santos /khaosdoctor @_staticvoid lsantos.me @khaosdoctor Lead Solutions
Architect
trainingcenter.io 2018.abcdevelopers.org obarra.co
Streams?
Array 1 2 3 4 5 6 7 8 9
10 11
Stream 2 3 4 5 6 7 8 9 10
11 1 Em espera
Stream 2 3 4 5 6 7 8 9 10
11 1 Requisitado 3 4 5 6 7 8 9 10 11 2 Em espera
Exemplos
Exemplos - Netflix - Youtube - Twitch - IoT Devices
- Logs - Steam Link - Gulp
Vantagens Não é só porque é legal Velocidade Eficiência
Implementações
Implementações - Node.js (https://nodejs.org/api/stream.html) - Bacon.js (https://baconjs.github.io/) - RxJS (https://rxjs-dev.firebaseapp.com/)
- Vanilla JS - Experimental (https://mzl.la/2zlQKkH)
Tipos de Streams
Readable Stream
Streams somente de leitura Stream Leitor
Writable Stream
Streams somente de escrita Stream Dados
Outros exemplos
Duplex Streams Tudo junto
Streams de leitura e escrita Stream Dados
Transform Streams Para quando não é o que queremos
Stream de transformação Transform Stream Dados Dados Modificados
Demo
Streams podem conter qualquer coisa - Eventos - Texto -
Números - Bits - Booleans
O que a gente pode fazer?
Pipe Stream Stream Leitor Pipe
Demo
Tee Stream Tee Stream Stream
Demo
Map
Demo
Filter
Demo
Scan
Demo
Skip
Demo
Take
Demo
Debounce
Demo
Debounce Immediate
Demo
Merge
Demo
Outros exemplos
<refs> - bit.ly/sobre-baconjs - bit.ly/sobre-debounce - bit.ly/imasters-streams - bit.ly/streams-node-medium -
mzl.la/mdn-streams - bit.ly/guia-rapido-streams - bit.ly/graficos-streams - bit.ly/mdn-exemplos - github.com/khaosdoctor/palestra-streams
/khaosdoctor @_staticvoid lsantos.me @khaosdoctor
Dê seu feedback! https://goo.gl/forms/kSZQlVGFYLpbkTLo1