Skip to content

Commit

Permalink
Always use a combined channel (#59)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl committed Aug 22, 2018
1 parent 1ffb6bc commit e933df3
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/transport-commons/lib/channels/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,8 @@ function channels () {
].find(current => typeof current === 'function') || noop;

Promise.resolve(callback(data, hook)).then(result => {
const channel = Array.isArray(result)
? new CombinedChannel(compact(flattenDeep(result)))
: result;
const results = Array.isArray(result) ? compact(flattenDeep(result)) : [ result ];
const channel = new CombinedChannel(results);

if (channel && channel.length > 0) {
app.emit('publish', event, channel, hook);
Expand Down

0 comments on commit e933df3

Please sign in to comment.