Skip to content

Commit

Permalink
refactor uninstall function in util.js
Browse files Browse the repository at this point in the history
  • Loading branch information
kanthesha committed Jul 23, 2024
1 parent a7d1093 commit 3a7ea87
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,14 @@ function createNewSub({ id, provider }) {
events.emit('notification', value)
})
// subscription uninstall method
async function uninstall(cb) {
const res = await provider.request({ method: 'eth_unsubscribe', params: [id] });
cb(null, res)
async function uninstall() {
return await provider.request({ method: 'eth_unsubscribe', params: [id] });
}
// return custom "subscription" api object
return {
id,
events,
uninstall: pify(uninstall),
uninstall,
}
}

Expand Down

0 comments on commit 3a7ea87

Please sign in to comment.