1.0.3 • Published 8 years ago

@f/channels v1.0.3

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

channels

Build status Git tag NPM version Code style

Minimal CSP channels.

Installation

$ npm install @f/channels

Usage

var createChannels = require('@f/channels')
var channels = createChannels()

var CH = 'CHANNEL'

channels.take(CH).then(function (val) {
  val // 42
})
channels.put(CH, 42).then(function (val) {
  val // true
})

API

channels()

Returns: instanced channels api

.take(channel)

  • channel - channel to take value from

Returns: promise that resolves to value that is put

.put(channel, value)

  • channel - channel to put value on
  • value - value to put

Returns: promise that resolves to true or false indicating whether value is taken

.close(channel)

  • channel - channel to close

License

MIT

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago