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

[hooks] Add cacheProvider prop to <Provider /> #340

Merged
merged 2 commits into from
May 3, 2022

Conversation

j-5-s
Copy link
Contributor

@j-5-s j-5-s commented Apr 20, 2022

See stories/useWriteContract for example.

Closes #310

Description

This exposes cacheProvider as a prop to <Provider /> to allow persistence with Web3Modal.

📝 Additional Information

I'd like to implement some tests for this but wasn't sure how to mock accounts and didn't see any setup for that. Any ideas or examples on the best pattern to do that?

See stories/useWriteContract for example.
@changeset-bot
Copy link

changeset-bot bot commented Apr 20, 2022

🦋 Changeset detected

Latest commit: 09f633a

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@web3-ui/hooks Minor
@web3-ui/core Patch
example Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@vercel
Copy link

vercel bot commented Apr 20, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
web3-ui-docs ✅ Ready (Inspect) Visit Preview May 3, 2022 at 10:32AM (UTC)
web3ui ✅ Ready (Inspect) Visit Preview May 3, 2022 at 10:32AM (UTC)

@RoseRompkxm
Copy link

This is exactly what this project is needed, why still no progress it's nearly 2 weeks!

@Dhaiwat10
Copy link
Member

LGTM, thanks @JamesCharlesworth!

@Dhaiwat10 Dhaiwat10 changed the title Initial commit for persistence [hooks] Add cacheProvider prop to <Provider /> May 3, 2022
@Dhaiwat10
Copy link
Member

I'd like to implement some tests for this but wasn't sure how to mock accounts and didn't see any setup for that. Any ideas or examples on the best pattern to do that?

I'm not really sure tbh. Maybe look into some existing tests that we have? I've seen some people use ethereum-waffle to mock stuff as well (that name might be slightly wrong)

@Dhaiwat10
Copy link
Member

@allcontributors please add @JamesCharlesworth for code

@allcontributors
Copy link
Contributor

@Dhaiwat10

I've put up a pull request to add @JamesCharlesworth! 🎉

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.

Implement cached provider in Provider component
3 participants