mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 02:10:08 +00:00
added promise result support...
Signed-off-by: Alex A. Naanou <alex.nanou@gmail.com>
This commit is contained in:
parent
11aa8be206
commit
544604a2bc
@ -409,11 +409,30 @@ module.ChildProcessPeer = core.ImageGridFeatures.Feature({
|
||||
|
||||
// return the value...
|
||||
if(!msg.ignore_return){
|
||||
process.send({
|
||||
type: 'action-call-result',
|
||||
id: msg.id,
|
||||
value: res === that ? null : res,
|
||||
})
|
||||
res.then ?
|
||||
// promise result...
|
||||
res
|
||||
.then(function(res){
|
||||
process.send({
|
||||
type: 'action-call-result',
|
||||
id: msg.id,
|
||||
value: res,
|
||||
})
|
||||
})
|
||||
.catch(function(err){
|
||||
process.send({
|
||||
type: 'action-call-result',
|
||||
id: msg.id,
|
||||
error: err,
|
||||
})
|
||||
})
|
||||
// normal result...
|
||||
: process
|
||||
.send({
|
||||
type: 'action-call-result',
|
||||
id: msg.id,
|
||||
value: res === that ? null : res,
|
||||
})
|
||||
}
|
||||
|
||||
// error...
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user