0.1.2 • Published 9 years ago

@koax/channels v0.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

channels

Build status Git tag NPM version Code style

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 on
  • val - value to put on channel

Returns: a put action

License

MIT