sparse-intern-71089
11/28/2018, 6:04 PMmicroscopic-florist-22719
apply as an input to pB.microscopic-florist-22719
gate is the apply you want to gate on and foo is the actual input you need, you can do this;microscopic-florist-22719
const gate = /* some apply */;
const foo = /* some value */;
const pB = new B("b", {
...
input: pulumi.all([foo, gate]).apply(([f]) => f);
});full-dress-10026
11/28/2018, 7:26 PMB doesn't need to use the output of pulumi.all?microscopic-florist-22719
B have any inputs? If so, you can mix it into one of thosemicroscopic-florist-22719
full-dress-10026
11/28/2018, 7:28 PMmicroscopic-florist-22719
microscopic-florist-22719
microscopic-florist-22719
all is in there is to ensure that the apply has finished before pB is createdmicroscopic-florist-22719
microscopic-florist-22719
const pB = new B("b", {
...
input: someInput,
});microscopic-florist-22719
apply that needs to run before pB is registered:microscopic-florist-22719
const gate = pA.foo.apply(foo => ...);microscopic-florist-22719
microscopic-florist-22719
const pB = new B("b", {
...
input: pulumi.all([someInput, gate]).apply(([i]) => i),
});microscopic-florist-22719
full-dress-10026
11/28/2018, 7:32 PMmicroscopic-florist-22719
microscopic-florist-22719
microscopic-florist-22719
full-dress-10026
11/28/2018, 7:39 PMfull-dress-10026
11/28/2018, 8:05 PMfunction waitForDatomic<T>(val: T): pulumi.Output<T> {
return pulumi.all([val, datomicGate]).apply(([v]) => v);
}full-dress-10026
11/28/2018, 8:07 PMpulumi.all returns Output<Unwrap<T>>. Not sure what the Unwrap does...microscopic-florist-22719
Unwrap does is "it's complicated" 🙂. @lemon-spoon-91807 can provide a longer answer.microscopic-florist-22719
full-dress-10026
11/28/2018, 8:09 PMUnwrap type declared?lemon-spoon-91807
11/28/2018, 8:10 PMlemon-spoon-91807
11/28/2018, 8:10 PMfull-dress-10026
11/28/2018, 8:11 PMlemon-spoon-91807
11/28/2018, 8:11 PMfull-dress-10026
11/28/2018, 8:11 PMpulumi.Unwrap.lemon-spoon-91807
11/28/2018, 8:11 PM{ foo: Promise<number>, bar: Promise<Promise<bool>[]> }lemon-spoon-91807
11/28/2018, 8:12 PM{ foo: number, bar: bool[] }lemon-spoon-91807
11/28/2018, 8:12 PMlemon-spoon-91807
11/28/2018, 8:14 PMlemon-spoon-91807
11/28/2018, 8:14 PMlemon-spoon-91807
11/28/2018, 8:14 PMlemon-spoon-91807
11/28/2018, 8:18 PM