Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add paused for subscriptions init object #143

Merged
merged 2 commits into from Oct 18, 2021

Conversation

logaretm
Copy link
Owner

What

Adds a paused boolean for useSubscription which starts the subscription in lazy mode, to initialize it you need to call resume().

Usage:

const { data } = useSubscription({
  query: SubscriptionQuery,
  paused: true,
})

closes #142

@codecov-commenter
Copy link

Codecov Report

Merging #143 (30851fa) into main (4641149) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #143      +/-   ##
==========================================
+ Coverage   94.70%   94.78%   +0.07%     
==========================================
  Files          26       26              
  Lines         529      537       +8     
  Branches       96       99       +3     
==========================================
+ Hits          501      509       +8     
  Misses         28       28              
Impacted Files Coverage Δ
packages/villus/src/Mutation.ts 100.00% <100.00%> (ø)
packages/villus/src/Query.ts 100.00% <100.00%> (ø)
packages/villus/src/Subscription.ts 94.44% <100.00%> (+0.69%) ⬆️
packages/villus/src/useSubscription.ts 92.72% <100.00%> (+0.41%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1aec7e7...30851fa. Read the comment docs.

@logaretm logaretm merged commit 9cfa418 into main Oct 18, 2021
@logaretm logaretm deleted the feat/add-paused-for-subscriptions branch October 18, 2021 00:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Question: async useSubscription
2 participants