mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-29 15:50:28 +01:00
466ece4588
This reverts commit1110287fe1
, reversing changes made to72eb233ee9
.
17 lines
323 B
JavaScript
17 lines
323 B
JavaScript
module.exports = createDnodeRemoteGetter
|
|
|
|
function createDnodeRemoteGetter (dnode) {
|
|
let remote
|
|
|
|
dnode.once('remote', (_remote) => {
|
|
remote = _remote
|
|
})
|
|
|
|
async function getRemote () {
|
|
if (remote) return remote
|
|
return await new Promise(resolve => dnode.once('remote', resolve))
|
|
}
|
|
|
|
return getRemote
|
|
}
|