Skip to content

Commit

Permalink
fix(): revert breaking change related to drivers
Browse files Browse the repository at this point in the history
Reverts behavior that breaks existing drivers that directly return
streams

Closes #35
  • Loading branch information
TylorS committed Dec 22, 2015
1 parent 1bd51e4 commit f110f0a
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,11 @@ const makeSinkProxies = drivers =>
return sinkProxies
}, {})

const callDrivers = (drivers, sinkProxies, disposableStream) =>
const callDrivers = (drivers, sinkProxies) =>
Object.keys(drivers)
.reduce((sources, driverName) => {
const source =
sources[driverName] =
drivers[driverName](hold(sinkProxies[driverName].stream), driverName)

sources[driverName] = typeof source.until === `function` ?
source.until(disposableStream) :
source

return sources
}, {})

Expand Down Expand Up @@ -65,7 +60,7 @@ const run = (main, drivers) => {
}
const {sink: disposableSink, stream: disposableStream} = subject()
const sinkProxies = makeSinkProxies(drivers, disposableStream)
const sources = callDrivers(drivers, sinkProxies, disposableStream)
const sources = callDrivers(drivers, sinkProxies)
const sinks = runMain(main, sources, disposableStream)
replicateMany(sinks, sinkProxies)

Expand Down

0 comments on commit f110f0a

Please sign in to comment.