From 9037dba6b8aa339d42364ee3907c93fad259481d Mon Sep 17 00:00:00 2001 From: Simon Frings Date: Wed, 25 Aug 2021 13:08:45 +0200 Subject: [PATCH] Update example to new eventloop API --- README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65447ed..ba57fd4 100644 --- a/README.md +++ b/README.md @@ -15,10 +15,16 @@ Once [installed](#install), you can use the following code to decorate a demo function and avoid sending unneeded HTTP requests: ```php -$browser = new React\Http\Browser($loop); +get('http://httpbingo.org/status/' . $id)->then(function (ResponseInterface $response) { + return $browser->get( + 'http://httpbingo.org/status/' . $id + )->then(function (Psr\Http\Message\ResponseInterface $response) { return $response->getStatusCode(); }); }