How to use the infinite function from pull-stream
Find comprehensive JavaScript pull-stream.infinite code examples handpicked from public code repositorys.
151 152 153 154 155 156 157 158 159 160
infinite(() => i++) --1--2--3--4--5--6--7--8-- ``` ```js var i = 0 const source = pull.infinite(() => i++) const sink = pull.log() pull(source, sink) ``` #### keys
46
839
48
75 76 77 78 79 80 81 82 83 84
return error && error.type === ERROR_TYPE_CREDS || isEnd(error); } function createPersistentLonpgollStream(api, rp, defaultTimeout = DEFAULT_TIMEOUT, maxTimeout = MAX_TIME_OUT) { return pull( pull.infinite(function() { return api; }), repeater(isEnd, defaultTimeout, maxTimeout), probe('creds'), credentialsStream, cacher(),
10
34
15
GitHub: clehner/pull-scroll
31 32 33 34 35 36 37 38 39 40
//load below the screen bottom, so that normal reading is jankless. //user provided source stream function createSource (top) { return pull( pull.infinite(), pull.map(function (e) { c((c()||0)+1) return {random: e, count: c(), top: top} }),
3
0
2
11 12 13 14 15 16 17 18 19 20
var h = require('mutant/h') //or hyperscript var pull = require('pull-stream') var obv = More(function (ary, item) { return [].concat(ary).concat(item) }, pull.infinite(), function (list, el) { //you might also use morphdom or just mutate the same element. return h('ol', list.map(function (n) { return h('li', ''+n) })) })
0
5
3
8 9 10 11 12 13 14 15 16
let duration = 5000; let frameSize = 1024; function sine () { return pull.infinite(function () { return util.noise(util.create(frameSize)) }) }
0
5
2
GitHub: pimterry/it-ws
4 5 6 7 8 9 10 11 12 13
// connect to the echo endpoint for test/server.js var socket = new WebSocket('wss://echo.websocket.org') // write values to the socket pull( pull.infinite(function () { return 'hello @ ' + Date.now() }), // throttle so it doesn't go nuts pull.asyncMap(function (value, cb) {
27
0
2
pull-stream.asyncMap is the most popular function in pull-stream (1458 examples)