Skip to content
Snippets Groups Projects
Commit 8e0a97ec authored by Daniel's avatar Daniel
Browse files

app/model: Hub: Add ability to pass reject func.

parent 9cb12e68
Branches
No related merge requests found
......@@ -39,13 +39,18 @@ class Hub {
let indexLambda = index.bind(this)
let unindexLambda = unindex.bind(this)
this.waitAsync = async (id, locations) => {
this.waitAsync = async (id, locations, rejectFunc) => {
let promise = new Promise((resolve, reject) => {
this.drivers[id] = {
resolve: resolve,
reject: reject
}
// Pass reject function.
if (rejectFunc) {
rejectFunc(reject)
}
// Index locations.
indexLambda(id, locations)
})
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment