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

hundreds-musician-51496

11/07/2018, 5:17 PM
What I really wanted was
pulumi.all({http, https}): Output<{http: ..., https: ,,,}>
w

white-balloon-205

11/07/2018, 6:32 PM
Cc @lemon-spoon-91807 who probably has thoughts on what’s best currently, and what we might add in the future to make some of these common patterns simpler.
πŸ‘ 1
l

lemon-spoon-91807

11/07/2018, 6:33 PM
i'm missing context.... but
pulumi.output({http, https})
should work.
it will give you an
Output<{http: Unwrapped..., https: Unwrapped...}>
h

hundreds-musician-51496

11/07/2018, 6:34 PM
http
has type
Output<Listener>
though
w

white-balloon-205

11/07/2018, 6:34 PM
@lemon-spoon-91807 see the thread of questions leading up to this in the channel for context.
l

lemon-spoon-91807

11/07/2018, 6:34 PM
can you supply a gist? i'd like to examine first hand. Thanks!
looking closely at the original post, i'd just repeat my first claim. specifically i think
pulumi.output({http, https})
will give you what you want.
it will give you the
Output<{http: ..., https: ...}>
type you are asking for
h

hundreds-musician-51496

11/07/2018, 6:42 PM
Ok, let me try it!
l

lemon-spoon-91807

11/07/2018, 6:42 PM
but i can't say for certain without having a gist to try out πŸ™‚
if you find that it doesn't work, def let me know and i'll investigate right away πŸ™‚
h

hundreds-musician-51496

11/07/2018, 6:43 PM
yeh that seesm to work - thank you
l

lemon-spoon-91807

11/07/2018, 6:44 PM
Terrific! While it's not a 100% replacement, pulumi.output is now the general purpose replacement for pulumi.all
it generally has the strictly better behavior that you want most of the time.
pulumi.all is more like a 'shallow' unwrapping of your value. while pulumi.output is a 'deep' unwrapping
most of hte time the latter is more appropriate.
h

hundreds-musician-51496

11/07/2018, 6:45 PM
yeh i see that it seems to cove most case
cooll i didnt know about it - thanks a bunch
l

lemon-spoon-91807

11/07/2018, 6:45 PM
one downside is simply that we're really exploiting some very complex TypeScript features. so sometimes when it doesn't do what you want... the error messages can be a bit... daunting πŸ™‚
h

hundreds-musician-51496

11/07/2018, 6:45 PM
BTW I love using all these higher-order types in real code - awesome API you guys have
l

lemon-spoon-91807

11/07/2018, 6:46 PM
you're welcome. have a good day!
Awesome to hear. We like it too πŸ™‚
h

hundreds-musician-51496

11/07/2018, 6:46 PM
I once got GHC to produce a 9k line error message so I'm not too nervous haha
l

lemon-spoon-91807

11/07/2018, 6:46 PM
You wouldn't happen to have a copy of that? I'd love to see it πŸ˜„
h

hundreds-musician-51496

11/07/2018, 6:50 PM
hehe sadly no, it was a long time ago.
2 Views