From d35f355e47eaecb45c6fef3194651aa417498572 Mon Sep 17 00:00:00 2001 From: sandyiscool Date: Sun, 26 Sep 2021 01:35:30 +0530 Subject: [PATCH] Fix a typo and add missing argument to function 1. `loadContributorsBackground` is the name of the function. 2. Add the missing `service` argument to `loadContributorsBackground` in the example. --- Introduction to Coroutines and Channels/03_UsingCallbacks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Introduction to Coroutines and Channels/03_UsingCallbacks.md b/Introduction to Coroutines and Channels/03_UsingCallbacks.md index 3c90fba..0b980b3 100644 --- a/Introduction to Coroutines and Channels/03_UsingCallbacks.md +++ b/Introduction to Coroutines and Channels/03_UsingCallbacks.md @@ -23,7 +23,7 @@ Now that all the loading has been moved to a separate thread, the main thread is ![](./assets/3-callbacks/Background.png) -The signature of the `loadContributors` function changes, it takes a `updateResults` callback as a last argument +The signature of the `loadContributorsBackground` function changes, it takes a `updateResults` callback as a last argument to call it after all the loading completes: ```kotlin @@ -34,7 +34,7 @@ fun loadContributorsBackground(service: GitHubService, req: RequestData, Now when the `loadContributorsBackground` is called, the `updateResults` call goes in the callback, not immediately afterwards as it did before: ```kotlin -loadContributorsBackground(req) { users -> +loadContributorsBackground(service, req) { users -> SwingUtilities.invokeLater { updateResults(users, startTime) }