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
0
90
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
86
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
190
The future of JavaScript
khaosdoctor
0
56
TypeScript tips that could save your life
khaosdoctor
0
180
É hora de falar sobre Deno
khaosdoctor
0
72
JS Software testing for beginners
khaosdoctor
0
73
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
39
The Dark Side of JavaScript
khaosdoctor
0
71
Integrating Containers Into JavaScript
khaosdoctor
0
63
Other Decks in Programming
See All in Programming
たった 1 枚の PHP ファイルで実装する MCP サーバ / MCP Server with Vanilla PHP
okashoi
1
190
Google Agent Development Kit でLINE Botを作ってみた
ymd65536
2
180
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
940
Benchmark
sysong
0
270
Team topologies and the microservice architecture: a synergistic relationship
cer
PRO
0
1k
Enterprise Web App. Development (2): Version Control Tool Training Ver. 5.1
knakagawa
1
120
エラーって何種類あるの?
kajitack
5
310
Team operations that are not burdened by SRE
kazatohiei
1
210
技術同人誌をMCP Serverにしてみた
74th
1
350
DroidKnights 2025 - 다양한 스크롤 뷰에서의 영상 재생
gaeun5744
3
320
関数型まつりレポート for JuliaTokai #22
antimon2
0
150
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
46
31k
Featured
See All Featured
GraphQLとの向き合い方2022年版
quramy
48
14k
StorybookのUI Testing Handbookを読んだ
zakiyama
30
5.8k
Fireside Chat
paigeccino
37
3.5k
Docker and Python
trallard
44
3.4k
Evolution of real-time – Irina Nazarova, EuRuKo, 2024
irinanazarova
8
790
Practical Orchestrator
shlominoach
188
11k
What’s in a name? Adding method to the madness
productmarketing
PRO
23
3.5k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
29
2.7k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
48
2.8k
Faster Mobile Websites
deanohume
307
31k
Rebuilding a faster, lazier Slack
samanthasiow
82
9.1k
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