BT

JavaScript Streams Introduced at Strange Loop

| by David Iffland Follow 4 Followers on Sep 28, 2015. Estimated reading time: 1 minute |

At the Strange Loop conference this year, Pam Selle introduced JavaScript streams, calling them "the data structure we need".

Streams are unlike typical sequential data manipulation. Selle says that streams "let us do list operations without the expense and annoyance of having to have them in a list structure."

While some may be familiar with streams in Node, Selle took the crowd on a journey from piping together UNIX commands to state of the art JavaScript with its ES6 generators. The latter are a part of the ES6 spec and Selle says the important thing to know is that they are "reusable and pausable functions" and that you'll know you're working with a generator when you see function* and yield. Here's what one looks like:

function* sayHello() {
    yield "hello";
}

Selle highlighted three libraries she like to work with: BaconJS, HighlandJS, and RxJS. RxJS in particular is poised to break out in 2016 due to promotion by a popular JavaScript framework. In Angular 2, observables are first-class entities and the new Angular 2 Http module uses RxJS observables. In the recent Angular 2 Survey Results, 38.7% of respondants indicated they plan to use RxJS while only 6.6% chose BaconJS. Additionally, ES7 includes a proposed observable type based on RxJS-style observables.

What excites Selle the most about streams is what uses people will come up with for them:

My dream is that you'll be able to do things like massive data visualizations. And that's the beginning. That's just the most obvious thing to me which means that people are going to do really cool things with it.

Front-end developers using the gulp build system are already familiar with streams. In gulp, commands are combined to perform build steps using the pipe() function.

The video of Selle's talk is available on YouTube and the slides are at http://pselle.github.io/omgstreams/. Next year's Strange Loop conference is September 15-17, 2016 in St. Louis.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread
Community comments

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Discuss

Login to InfoQ to interact with what matters most to you.


Recover your password...

Follow

Follow your favorite topics and editors

Quick overview of most important highlights in the industry and on the site.

Like

More signal, less noise

Build your own feed by choosing topics you want to read about and editors you want to hear from.

Notifications

Stay up-to-date

Set up your notifications and don't miss out on content that matters to you

BT