This message was deleted.
# typescript
s
This message was deleted.
g
You can export the variable separately from assignment with a
let
. I did that in this example: https://github.com/pulumi/examples/blob/master/kubernetes-ts-multicloud/index.ts#L48-L63
So you could have the actual creation inside the conditional
c
🙏
and the variable would be initialized as
undefined
?
c
and the variable would be initialized as
undefined
?
You could also do
let x: SomeType | undefined
that allows
x
to be undefined sometimes. But that means, wherever you use
x
, you will need to make sure that it is not
undefined
before you use it.
c
ok - it looks like I can just declare it like :`export let nginx:ingressController.NginxIngressController;`
and conditionally set it later
Working well - thanks!!