@koax/channels
v0.1.2
Published
Koax CSP channels.
Downloads
16
Readme
channels
Koax CSP channels [included in Koax].
Installation
$ npm install @koax/channelsUsage
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
