From 8f24739cbeacd732b0d50c3a712e22e6caf86294 Mon Sep 17 00:00:00 2001 From: Ellen Shapiro Date: Thu, 5 Sep 2019 20:15:36 -0500 Subject: [PATCH] =?UTF-8?q?use=20return=20result=20async=20if=20needed=20w?= =?UTF-8?q?here=20actual=20comment=20was=20=F0=9F=98=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Sources/Apollo/ApolloStore.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/Sources/Apollo/ApolloStore.swift b/Sources/Apollo/ApolloStore.swift index c834f061b4..47c1d6e003 100644 --- a/Sources/Apollo/ApolloStore.swift +++ b/Sources/Apollo/ApolloStore.swift @@ -55,12 +55,9 @@ public final class ApolloStore { self.cacheLock.withWriteLock { self.cache.clearPromise() }.andThen { - guard let completion = completion else { - return - } - callbackQueue.async { - completion(.success(())) - } + DispatchQueue.apollo_returnResultAsyncIfNeeded(on: callbackQueue, + action: completion, + result: .success(())) } } }