Releases: atomicojs/hooks
Releases · atomicojs/hooks
new hooks useScript and useAttributes
useScript
const src = "https://code.jquery.com/jquery-3.6.0.min.js";
cons done = ()=> console.log( $ );
const status = useScript(src, done);
where:
src
: javascript type resource to inject into document.headdone
: optional , callback when called at the end of the script loadstatus
: script load status
useAttributes
const attrs = useAttributes();
Where:
attrs
: all the attributes defined on the webcomponent but that are not props, to facilitate reading this hook transforms the index to camelCase
fix null for usePropProxy
3.35.1 fix null for usePropProxy
add the usePropProxy hook
usePropProxy
create a proxy as setter and getter on a property associated to the webcomponent instance
this is useful for communicating values from references or watching for mutations before updates
Example
usePropProxy("value",{
get: ()=> refInput.current?.value
set: (value)=> refInput.current.value = value
})
internal enhancement of useCssLightDom
add dependency @atomico/design-tokens to extend support to firefox and safari
fix the error by unmounting the style tag
3.33.6 fix the error by unmounting the style tag
Fix type usePromise
3.33.5 fix type usePromise
fix useHistory, useRouter and useReflectEvent
useHistory: remove the use of Array.at.
useRouter: fix use of composite, to prevent events from nested shadow dom.
useReflectEvent: improves the analysis of reflect events.
Fix the listener in the useClickCoordinates hook
3.33.3 fix listener
fix type of useRedirect
3.33.2 fix type of useRedirect
fix useHistory
3.33.1 fix useHistory