mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-22 05:45:18 +02:00
All transaction-based ControlService methods now return promises directly, which makes it easier to integrate with other promises, is simpler and opens up new refactoring opportunities.
This commit is contained in:
@@ -46,7 +46,7 @@ module.exports = function ControlServiceFactory(
|
||||
function sendTwoWay(action, data) {
|
||||
var tx = TransactionService.create(target)
|
||||
socket.emit(action, channel, tx.channel, data)
|
||||
return tx
|
||||
return tx.promise
|
||||
}
|
||||
|
||||
function touchSender(type) {
|
||||
@@ -117,7 +117,7 @@ module.exports = function ControlServiceFactory(
|
||||
socket.emit('storage.upload', channel, tx.channel, {
|
||||
url: url
|
||||
})
|
||||
return tx
|
||||
return tx.promise
|
||||
}
|
||||
|
||||
this.uploadFile = function(files) {
|
||||
@@ -135,7 +135,7 @@ module.exports = function ControlServiceFactory(
|
||||
, file: files[0]
|
||||
})
|
||||
})
|
||||
return tx
|
||||
return tx.promise
|
||||
}
|
||||
|
||||
this.install = function(options) {
|
||||
|
||||
Reference in New Issue
Block a user