chan icon indicating copy to clipboard operation
chan copied to clipboard

doc: an example doesn't work

Open iliakan opened this issue 10 years ago • 0 comments

While reading the doc at https://github.com/brentburg/chan#sending-values-to-the-channel, it appears that this code should execute the callback:

ch('foo')(function (err) {
  if (err) {
    // There was an error putting the value on the channel
  } else {
    // The value was successfully put on the channel
  }
})

In fact, it doesn't execute the callback (when ch = makeChan()). Did you mean a buffered channel here?

P.S. Or maybe add a "yield ch" block that would make it work?

Your channels are co-compatible unlike js-csp, that's cool.

iliakan avatar Jun 17 '15 06:06 iliakan