Skip to content

Commit c8f9f30

Browse files
Ben52Akryum
authored andcommitted
Pass back isLoading to scoped-slot (#218)
* Pass back `isLoading` to scoped-slot Right now `loading` is only set when a result is received, not when the request is sent. Using `watchLoading`, we can pass the loading state from when the request is sent. * Use $apolloData.loading We can simply use the $apolloData.loading property to get the current loading state of the query.
1 parent 82d6c02 commit c8f9f30

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/ApolloQuery.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,7 @@ export default {
165165
let result = this.$scopedSlots.default({
166166
result: this.result,
167167
query: this.$apollo.queries.query,
168+
isLoading: this.$apolloData.loading,
168169
})
169170
if (Array.isArray(result)) {
170171
result = result.concat(this.$slots.default)

0 commit comments

Comments
 (0)