alta-any
Get a value from any of the channels
Last updated a year ago by mattmueller .
Repository · Bugs · Original npm · Tarball
$ cnpm install alta-any 
SYNC missed versions from official npm registry.

alta-any

Get a value from any of the channels.

Included in the alta-kit.

Example

let a = Channel()
let b = Channel()
let ab = any(a, b)

a.put(1)
a.put(1)
b.put(2)

var [ value, channel ] = await ab()
assert.equal(channel, a)
assert.equal(value, 1)

var [ value, channel ] = await ab()
assert.equal(channel, b)
assert.equal(value, 2)

var [ value, channel ] = await ab()
assert.equal(channel, a)
assert.equal(value, 1)

Install

npm install alta-any

License

MIT

Maintainers (1)
Downloads
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (2)
Dependents (1)

Copyright 2014 - 2017 © taobao.org |