import Web3 from 'web3' ; let getWeb3 = new Promise ( ( resolve , reject ) => { window . addEventListener ( 'load' , ( ) => { var results ; var web3 = window [ 'web3' ] ; if ( typeof web3 !== 'undefined' ) { web3 = new Web3 ( web3 . currentProvider ) ; results = { web3 : web3 } ; console . log ( 'Injected web3 detected.' ) ; resolve ( results ) ; } else { resolve ( 'no_web3_provider' ) ; } } ) ; } ) ; export default getWeb3 ;