chan
chan copied to clipboard
doc: an example doesn't work
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.