@timesinternet/times-ondemandloader

1.0.3 • Public • Published

A React component to load external js files

Installation

Browser

npm install --save @timesinternet/times-ondemandloader

Browser

import OnDemandLoader from 'times-ondemandloader';


export class MyComponent extends Component {
  componentWillMount() {
    this.scriptCache = OnDemandLoader({
      slikeSDK: 'https://videoplayer.indiatimes.com/v2/sdk.js'
    });
  }

  componentDidMount() {
    this.scriptCache.slikeSDK.onLoad(() => {
      console.log('slike sdk loaded');
    })
  }
  render(){
    return(
      <div>
        
      </div>   
    )
  }
}

export default MyComponent;

License

Package Sidebar

Install

npm i @timesinternet/times-ondemandloader

Weekly Downloads

0

Version

1.0.3

License

ISC

Unpacked Size

5.87 kB

Total Files

3

Last publish

Collaborators

  • mohit.rathi
  • sandeep.panwar
  • til