Skip to content
This repository was archived by the owner on Feb 12, 2024. It is now read-only.

Promisify init #866

Merged
merged 1 commit into from
May 25, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/core/components/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@ const peerId = require('peer-id')
const waterfall = require('async/waterfall')
const parallel = require('async/parallel')
const isNode = require('detect-node')
const promisify = require('promisify-es6')

const addDefaultAssets = require('./init-assets')

module.exports = function init (self) {
return (opts, callback) => {
return promisify((opts, callback) => {
if (typeof opts === 'function') {
callback = opts
opts = {}
Expand Down Expand Up @@ -104,5 +105,5 @@ module.exports = function init (self) {
})
}
], done)
}
})
}