Buckets:
Quantumbraid/trainingdata / ui /node_modules /react-zoom-pan-pinch /src /hooks /use-transform-init.tsx
| import { useEffect } from "react"; | |
| import { getState } from "utils"; | |
| import { ReactZoomPanPinchContextState } from "../models"; | |
| import { useTransformContext } from "./use-transform-context"; | |
| export const useTransformInit = ( | |
| callback: (ref: ReactZoomPanPinchContextState) => void | (() => void), | |
| ): void => { | |
| const libraryContext = useTransformContext(); | |
| useEffect(() => { | |
| let unmountCallback: void | (() => void); | |
| let unmount: void | (() => void); | |
| if (libraryContext.contentComponent && libraryContext.wrapperComponent) { | |
| unmountCallback = callback(getState(libraryContext)); | |
| } else { | |
| unmount = libraryContext.onInit((ref) => { | |
| unmountCallback = callback(getState(ref.instance)); | |
| }); | |
| } | |
| return () => { | |
| unmount?.(); | |
| unmountCallback?.(); | |
| }; | |
| // eslint-disable-next-line react-hooks/exhaustive-deps | |
| }, []); | |
| }; | |
Xet Storage Details
- Size:
- 887 Bytes
- Xet hash:
- a75cbec9bf510c79473fe7dd24a87730a172e5750324116cd107efa0add2af08
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.