Skip to content

Conversation

gabrielsroka
Copy link

No description provided.

@gabrielsroka
Copy link
Author

gabrielsroka commented Sep 26, 2024

that won't work. they still have to await it because the method is async.

u can try it both ways and see.

@built-by-as
Copy link
Owner

that won't work. they still have to await it because the method is async.

u can try it both ways and see.

the caller has to use await, but r.json() is a promise. if you don't await that then the caller needs to do:

const res = await postJson(); <- this is a promise, not the json
const jsonRes = await res;

instead of just

const jsonRes = await postJson();

@gabrielsroka
Copy link
Author

that's not how it works. did you try it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants