- $this->app->getRequest()->getQuery("page"),
- [$this, "reposCallback"]
- )->send();
- $this->app->display("github/index");
- }
- }
-
- function reposCallback($repos, $links) {
- $this->app->getView()->addData(compact("repos", "links"));
-
- foreach ($repos as $repo) {
- $this->github->listHooks($repo->full_name, function($hooks) use($repo) {
- $repo->hooks = $hooks;
+ $this->app->getRequest()->getQuery("page")
+ )->then(
+ new ReposCallback($this->github)
+ )->done(function($results) {
+ list(list($repos, $links)) = $results;
+ $this->app->display("github/index", compact("repos", "links"));