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
Lucas Santos
November 28, 2018
Programming
100
0
Share
Streams no Javascript
Palestra sobre o uso de streams no Javascript
Lucas Santos
November 28, 2018
More Decks by Lucas Santos
See All by Lucas Santos
The Hitchhiker's Guide for an Amazing API with TypeScript
khaosdoctor
0
120
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
210
The future of JavaScript
khaosdoctor
0
82
TypeScript tips that could save your life
khaosdoctor
0
240
É hora de falar sobre Deno
khaosdoctor
0
88
JS Software testing for beginners
khaosdoctor
0
98
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
53
The Dark Side of JavaScript
khaosdoctor
0
90
Integrating Containers Into JavaScript
khaosdoctor
0
81
Other Decks in Programming
See All in Programming
「なんか〇〇ライブラリで脆弱性あるみたいなんだけど。。。」から始める脆弱性対応 / First Steps in Vulnerability Response
mackey0225
2
120
検索設計から 推論設計への重心移動と Recall-First Retrieval
po3rin
5
1.7k
AWSはOSSをどのように 考えているのか?
akihisaikeda
0
120
ついに来た!本格的なマルチクラウド時代の Google Cloud
maroon1st
0
430
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
340
Programming with a DJ Controller — not vibe coding
m_seki
3
850
Skillは並べた。動かなかった。契約で繋いだ。— 65個のSkillから、自走する開発サイクルへ
junholee
0
540
AIベース静的検査器の偽陽性率を抑える工夫3選
orgachem
PRO
4
460
Agent Skills を社内で育てる仕組み作り
jackchuka
1
2k
リセットCSSを1行消したらアクセシビリティが向上した話
pvcresin
4
510
Back to the roots of date
jinroq
0
840
ふにゃっとしない名前の付け方 〜哲学で茹で上げる、コシのあるソフトウェア設計〜
shimomura
0
120
Featured
See All Featured
Unsuck your backbone
ammeep
672
58k
How to make the Groovebox
asonas
2
2.2k
The Limits of Empathy - UXLibs8
cassininazir
1
330
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
180
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
65
54k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
[SF Ruby Conf 2025] Rails X
palkan
2
1k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8.1k
What's in a price? How to price your products and services
michaelherold
247
13k
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.5k
Done Done
chrislema
186
16k
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