var o = new X();
o.setFooCallback1(function(result1){
});
o.setFooCallback2(function(result2){
});
o.foo("xxx");
as you can see, when I call o.foo()
, there're two callbacks will be fired with two results, result1
and result2
, what I want to do is use pass result1
and result2
to my constructor function to create an object:
var y = new Y(result1, result2);
But result1 and result2 come in different time(asynchronous), how could I handle this?
ps: the class X
is from others' library, I can't modify it's implemention