@monkeycf/dynamic-script

1.1.0 • Public • Published

@monkey/dynamic-script

dynamic loading JavaScript

example

  import dynamicScript from '@monkeycf/dynamic-script'

  dynamicScript('${your script url}')
    .then(({element, event}) => {
      // to do something
    })
    .catch(({element, event}) => {
      // processing error
    })

如果想使用“事件捕获”,可设置 isCapturing 为 true

   dynamicScript('${your script url}', true)
    .then(({element, event}) => {
      // to do something
    })
    .catch(({element, event}) => {
      // processing error
    })

Readme

Keywords

none

Package Sidebar

Install

npm i @monkeycf/dynamic-script

Weekly Downloads

1

Version

1.1.0

License

MIT

Unpacked Size

2.99 kB

Total Files

5

Last publish

Collaborators

  • monkeycf