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
100
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
110
Escalando globalmente com TypeScript e JavaScript na Klarna
khaosdoctor
0
200
The future of JavaScript
khaosdoctor
0
62
TypeScript tips that could save your life
khaosdoctor
0
220
É hora de falar sobre Deno
khaosdoctor
0
79
JS Software testing for beginners
khaosdoctor
0
91
Ambientes dinâmicos com GitHub Actions
khaosdoctor
0
47
The Dark Side of JavaScript
khaosdoctor
0
82
Integrating Containers Into JavaScript
khaosdoctor
0
72
Other Decks in Programming
See All in Programming
nuget-server - あなたが必要だったNuGetサーバー
kekyo
PRO
0
220
DSPy入門 Pythonで実現する自動プロンプト最適化 〜人手によるプロンプト調整からの卒業〜
seaturt1e
1
660
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
AWS Infrastructure as Code の新機能 2025 総まとめ 〜SA 4人による怒涛のデモ祭り〜
konokenj
10
3.3k
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
260
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
660
AI時代でも変わらない技術コミュニティの力~10年続く“ゆるい”つながりが生み出す価値
n_takehata
2
700
エラーログのマスキングの仕組みづくりに役立ったASTの話
kumoichi
0
160
ロボットのための工場に灯りは要らない
watany
10
2.4k
Go 1.26でのsliceのメモリアロケーション最適化 / Go 1.26 リリースパーティ #go126party
mazrean
1
370
AI Assistants for Your Angular Solutions
manfredsteyer
PRO
0
130
nilとは何か 〜interfaceの構造とnil!=nilから理解する〜
kuro_kurorrr
3
1.9k
Featured
See All Featured
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
0
200
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
67
37k
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
140
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Deep Space Network (abreviated)
tonyrice
0
87
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Exploring the relationship between traditional SERPs and Gen AI search
raygrieselhuber
PRO
2
3.7k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.9k
Designing Powerful Visuals for Engaging Learning
tmiket
0
270
The Illustrated Children's Guide to Kubernetes
chrisshort
51
52k
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