detect-var
v1.0.0
Published
Wait for any async injected variables. such as ethereum provider `window.ethereum`
Downloads
2
Readme
detect-var
Wait for any async injected variables. such as ethereum provider window.ethereum
Usage
import detectVar from 'detect-var'
const ethereum = await detectVar(() => window.ethereum)
console.log(ethereum === window.ethereum) // true
Parameter
detectVar(fn, [options])
- fn: return the object to be detected
- options
- timeout:
number
maximum detection time, default 5000 ms - step:
number
interval between each detect, default 500 ms
- timeout: