1.0.1 • Published 8 years ago

alta-any v1.0.1

Weekly downloads
6
License
-
Repository
github
Last release
8 years ago

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