I can't wrap my head around this, maybe someone ca...
# typescript
s
I can't wrap my head around this, maybe someone can help me out. I want do implement a default value for an optional pulumi.Input where the default value is also an pulumi.Input. This doesn't work:
Copy code
function getValue(optionalValue: pulumi.Input<number | undefined>, defaultValue: pulumi.Input<number>): pulumi.Input<number> {
    return pulumi.output(optionalValue).apply( v => {
        return v ?? defaultValue
    })
}
Error:(91, 9) TS2322: Type 'Output<Input<number>>' is not assignable to type 'Input<number>'. Type 'OutputInstance<Input<number>>' is not assignable to type 'Input<number>'. Type 'OutputInstance<Input<number>>' is not assignable to type 'OutputInstance<number>'. Type 'Input<number>' is not assignable to type 'number'. Type 'Promise<number>' is not assignable to type 'number'.