Skip to content

Commit

Permalink
Account for fireAndForget return value
Browse files Browse the repository at this point in the history
  • Loading branch information
bluepnume committed Jan 15, 2019
1 parent b2cd42e commit f2292be
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/serialize/function.js
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,12 @@ export function deserializeFunction<T>(source : CrossDomainWindowType | ProxyWin
if (meth && meth.val !== crossDomainFunctionWrapper) {
return meth.val.apply({ source: window, origin: getDomain() }, arguments);
} else {
return global.send(win, MESSAGE_NAME.METHOD, { id, name, args: Array.prototype.slice.call(arguments) }, { domain: origin, ...opts })
.then(({ data }) => data.result);
return global.send(win, MESSAGE_NAME.METHOD, { id, name, args: Array.prototype.slice.call(arguments) }, { domain: origin, fireAndForget: opts.fireAndForget })
.then(res => {
if (!opts.fireAndForget) {
return res.data.result;
}
});
}

}).catch(err => {
Expand Down

0 comments on commit f2292be

Please # to comment.