Skip to content

Releases: atomicojs/hooks

new hooks useScript and useAttributes

25 Apr 17:36
Compare
Choose a tag to compare

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

fix null for usePropProxy

22 Apr 05:30
Compare
Choose a tag to compare
3.35.1

fix null for usePropProxy

add the usePropProxy hook

22 Apr 05:18
Compare
Choose a tag to compare

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

21 Apr 03:51
Compare
Choose a tag to compare

add dependency @atomico/design-tokens to extend support to firefox and safari

fix the error by unmounting the style tag

14 Apr 01:10
Compare
Choose a tag to compare
3.33.6

fix the error by unmounting the style tag

Fix type usePromise

10 Apr 21:14
Compare
Choose a tag to compare
3.33.5

fix type usePromise

fix useHistory, useRouter and useReflectEvent

30 Mar 03:24
Compare
Choose a tag to compare

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

27 Mar 04:13
Compare
Choose a tag to compare

fix type of useRedirect

22 Mar 03:46
Compare
Choose a tag to compare
3.33.2

fix type of useRedirect

fix useHistory

21 Mar 03:56
Compare
Choose a tag to compare
3.33.1

fix useHistory