mirror of
https://github.com/flynx/ImageGrid.git
synced 2025-10-29 18:30:09 +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,7 +409,26 @@ module.ChildProcessPeer = core.ImageGridFeatures.Feature({
|
|||||||
|
|
||||||
// return the value...
|
// return the value...
|
||||||
if(!msg.ignore_return){
|
if(!msg.ignore_return){
|
||||||
|
res.then ?
|
||||||
|
// promise result...
|
||||||
|
res
|
||||||
|
.then(function(res){
|
||||||
process.send({
|
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',
|
type: 'action-call-result',
|
||||||
id: msg.id,
|
id: msg.id,
|
||||||
value: res === that ? null : res,
|
value: res === that ? null : res,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user