Releases: atomicojs/hooks
Releases · atomicojs/hooks
Fix ts spread types
3.42.2 fix ts spread types
Fixes the time to observe the resizing of references
3.42.1 fixes the time to observe the resizing of references
Add third parameter for useRefValues
this parameter moves the effect from the useLayoutEffect cycle to the useEffect cycle.
Example
useRefValues(ref,()=>{
// I run in the useEffect cycle
},true);
add the useRefIntersectionObserver hook
improve the useResponsiveState and useResizeState api
template string mode
useResponsiveState
this hook watches the media query
const value = useResponsiveState`
default value,
${768} 768px
${1080} 1080px
`;
useResizeState
this hook observes the width of the webcomponent
const value = useResizeState`
default value,
${768} 768px
${1080} 1080px
`;
3.39.0
Changes
- Update the version of Atomico :
"atomico": "^1.58.0"
, avoid updating no you are not working with a version equal to or greater than the commented one. - add hook useRefValue https://atomico.gitbook.io/doc/atomico/atomico-hooks/use-ref-values
Add modes for useDebounceState
useDebounceState
Example mode timeout
default mode based on setTimeout
const ms = 100;
const initialState = {};
useDebounceState( ms , initialState,);
Example mode fps
mode based on requestAnimationFrame
const fps = 1;
const initialState = {};
useDebounceState( fps , initialState, "fps");
Example mode idle
mode based on requestIdleCallback
const timeout = 1;
const initialState = {};
useDebounceState( timeout, initialState, "idle");
Use render now check if it is in ssr mode
this does not break the above code, but if you want to disable useRender in ssr mode, you must have a version of Atomico greater than or equal to 1.56.0
Fix peerDependencies of subpackages
3.36.2 fix peerDependencies of subpackages
Fix the import of the sub package.json
3.36.1 fix the import of the subpackage.json