Skip to content

factor out post/postJson#1

Open
gabrielsroka wants to merge 4 commits intobuilt-by-as:mainfrom
gabrielsroka:patch-1
Open

factor out post/postJson#1
gabrielsroka wants to merge 4 commits intobuilt-by-as:mainfrom
gabrielsroka:patch-1

Conversation

@gabrielsroka
Copy link
Copy Markdown

No description provided.

Comment thread llm.js
Comment thread llm.js
@gabrielsroka
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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