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

Unsubscribe all events #15

Merged
merged 5 commits into from Jul 27, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/web3-store.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ export const createStore = () => {
}))
}

const close = async (provider) => {
if(provider && provider.close) {
await provider.close()
const disconnect = async (provider) => {
if(provider && provider.disconnect) {
await provider.disconnect()
}
update(() => ({
connected: false,
Expand All @@ -95,7 +95,7 @@ export const createStore = () => {
return {
setBrowserProvider,
setProvider,
close,
disconnect,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should leave close as an alias not to break code on upgrade so brutally. close can console.log deprecated and call disconnect

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we don't need the log then, unless you plan to change the function name to disconnect in the future.

subscribe
}
}
Expand Down