https://pulumi.com logo
#general
Title
# general
b

brash-kite-78002

08/12/2021, 11:42 AM
Hello Everyone! I want to clarify one thing. Currently, I'm passing a Promise to the chart's "skipCRDRendering" property. My code seems to work, and it looks like that although this property accepts only boolean, internally, it handles the Promises too. Am I right? P.S. I'm using Typescript.
s

steep-toddler-94095

08/12/2021, 5:12 PM
How is your code passing the type checks if you are passing a
Promise<boolean>
to a
boolean
? The field should be
Input<boolean>
if it accepts Promises, Outputs, etc. The equality operator is able to be used with Promises, but it won't necessarily give you what you want. For example,
new Promise(()={}) == <true or false>
will both give you
false
b

brash-kite-78002

08/13/2021, 4:08 PM
I just trick the compiler with type casting.
Copy code
// prometheusCrdsExistence: Promise<boolean>;

skipCRDRendering: <boolean><unknown>cluster.crdsInitModule?.prometheusCrdsExistence.then(
    result => { return result }
);
And the promise handling works because of this, if I'm not mistaken
6 Views