Open Gummibeer opened 3 years ago
relates to #82
Instead of doing $this->paginated(...) in the job it would be cool to do Http::github()->get()->paginated(fn() => ...).
$this->paginated(...)
Http::github()->get()->paginated(fn() => ...)
The paginated macro should accept one closure argument that runs for each response and gets the response instance as it's own argument.
paginated
Http::github() ->get("/orgs/{$this->organization->name}/repos") ->paginated(function(\Illuminate\Http\Client\Response $response): void { $response->collect()->map(...); });
https://github.com/Astrotomic/opendor.me/blob/b258e25c1d10e0fc1100a634290431bc1bcc8665/app/Jobs/SyncUserContributions.php#L25-L47
relates to #82
Instead of doing
$this->paginated(...)
in the job it would be cool to doHttp::github()->get()->paginated(fn() => ...)
.The
paginated
macro should accept one closure argument that runs for each response and gets the response instance as it's own argument.https://github.com/Astrotomic/opendor.me/blob/b258e25c1d10e0fc1100a634290431bc1bcc8665/app/Jobs/SyncUserContributions.php#L25-L47