JSFiddle - React, Tailwind, and code Playground
by amatiasq
HTML
<script src="http://amatiasq.github.io/streams/dist/stream.min.js"></script>
<script src="http://amatiasq.com/fiddle-console.js"></script>
JavaScript
var promise1 = new Promise(function(resolve, reject) {
setTimeout(function() { resolve(1) }, 0);
});
var stream1 = ReadableStream.fromPromise(promise1);
stream1.log('STREAM-1');
var promise2 = new Promise(function(resolve, reject) {
setTimeout(function() { reject(new Error('FAYUL')) }, 0);
});
var stream2 = ReadableStream.fromPromise(promise2);
stream2.log('STREAM-2');