Skip to content

Commit

Permalink
whitespace fix.. still resetting my .vimrc!
Browse files Browse the repository at this point in the history
  • Loading branch information
bbarr authored Jul 19, 2016
1 parent 73285a7 commit bba925e
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,10 @@ export function merge(...chs) {
// AnyInput -> Promise
export function any(...ports) {

const alreadyReady = ports.filter(isResolvable)
const alreadyReady = ports.filter(isResolvable)

if (alreadyReady.length > 0)
return resolveLazyPuts(random(alreadyReady))
if (alreadyReady.length > 0)
return resolveLazyPuts(random(alreadyReady))

return new Promise(res => {

Expand Down Expand Up @@ -210,14 +210,14 @@ const isPromise = port => port instanceof Promise
const isPut = port => Array.isArray(port)

const isResolvable = port => {
if (isPromise(port)) return false
if (isChan(port)) return !port.buffer.isEmpty()
if (isPut(port)) return port[0].takes.length
if (isPromise(port)) return false
if (isChan(port)) return !port.buffer.isEmpty()
if (isPut(port)) return port[0].takes.length
}

const resolveLazyPuts = port => {
if (!isPut(port)) return port.then(v => [ v, port ])
return put(port[0], port[1]).then(v => [ v, port[0] ])
if (!isPut(port)) return port.then(v => [ v, port ])
return put(port[0], port[1]).then(v => [ v, port[0] ])
}

const createAction = (config={}) => {
Expand Down

0 comments on commit bba925e

Please sign in to comment.