Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response: Synchronous await methods #220

Closed
g105b opened this issue Jan 30, 2024 · 0 comments · Fixed by #221
Closed

Response: Synchronous await methods #220

g105b opened this issue Jan 30, 2024 · 0 comments · Fixed by #221

Comments

@g105b
Copy link
Member

g105b commented Jan 30, 2024

Following on from PhpGt/Fetch#153, it would be nice to simulate the "await" keyword in JS:

JS version:

const response = await fetch("/api");
const jsonObject = await response.json();

PHP version:

$response = $http->awaitFetch("/api");
$jsonObject = $response->awaitJson();
g105b added a commit that referenced this issue Jan 30, 2024
g105b added a commit that referenced this issue Jan 31, 2024
* feature: async response methods for #220

* build: build with 8.1 compatibility

* tweak: allow more public methods
@github-project-automation github-project-automation bot moved this to Done January 2024 in Overview Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done January 2024
Development

Successfully merging a pull request may close this issue.

1 participant