mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-11-23 02:10:12 +01:00
aa41057628
* eslint: Enable curly and brace-style * yarn lint --fix
19 lines
337 B
JavaScript
19 lines
337 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
|
|
}
|