0.1.2 • Published 9 years ago
@koax/channels v0.1.2
channels
Koax CSP channels included in Koax.
Installation
$ npm install @koax/channels
Usage
import koax from 'koax'
import {put, take} from '@koax/channels'
let app = koax()
let CH = 'CHANNEL'
app(function * () {
yield take(CH) // => 42
})
app (function * () {
yield put(CH, 42) // => true
})
API
take(channel)
channel
- channel to take value from
Returns: a take action
put(channel, val)
channel
- channel to put value onval
- value to put on channel
Returns: a put action
License
MIT