JS-FETCH
Asynchronous JavaScript loader for client such as Google Map API, Twitter widget,...
Installation
yarn add js-fetch
Usage
jsFetch(CDNPath [, variablePath = null [, attributes = {} [, timeout = 15000]]])
positional arguments:
CDNPath url path(ex: https://maps.googleapis.com/maps/api/js)
variablePath variable global support path string (ex: 'google', 'google.maps.Map')
attributes attributes in script tag (ex: {async: true})
timeout timeout for waiting load CDNPath
Examples
CDN
;});
In Vue
; Vue;
In React
; { ; } { return <div className="App"> <div style=width: '100%' height: '400px' ref= { thismap = map; } /> </div> ; }
License
MIT © Nghiep