Skip to content
Discussion options

You must be logged in to vote

Hey @evgeniyworkbel

I don't think you need to await the config promise to be honest. Either way, it should work fine.

More specifically, both getPayload and BasePayload.init will await the config as appropriate. If you await the config promise in advance of calling getPayload, then the behavior will be the same. The underlying code will await it anyway, and using await on a resolved promise or primitive value doesn't cause any negative consequences or overhead as far as I'm aware. It is safe.

I'm adding a few links below, so that you may look through the code and explore what these functions do, and where exactly your config gets threaded through to in this process.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by evgeniyworkbel
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants