Skip to content

new hooks useScript and useAttributes

Compare
Choose a tag to compare
@UpperCod UpperCod released this 25 Apr 17:36
· 135 commits to master since this release

useScript

const src = "https://code.jquery.com/jquery-3.6.0.min.js";
cons done = ()=> console.log( $ );
const status = useScript(src, done);

where:

  1. src: javascript type resource to inject into document.head
  2. done: optional , callback when called at the end of the script load
  3. status: script load status

useAttributes

const attrs = useAttributes();

Where:

  1. attrs: all the attributes defined on the webcomponent but that are not props, to facilitate reading this hook transforms the index to camelCase