Buckets:
Quantumbraid/trainingdata / ui /node_modules /react-zoom-pan-pinch /src /hooks /use-transform-effect.tsx
| import { useEffect } from "react"; | |
| import { getState } from "utils"; | |
| import { ReactZoomPanPinchContextState } from "../models"; | |
| import { useTransformContext } from "./use-transform-context"; | |
| export const useTransformEffect = ( | |
| callback: (ref: ReactZoomPanPinchContextState) => void | (() => void), | |
| ): void => { | |
| const libraryContext = useTransformContext(); | |
| useEffect(() => { | |
| let unmountCallback: void | (() => void); | |
| const unmount = libraryContext.onChange((ref) => { | |
| unmountCallback = callback(getState(ref.instance)); | |
| }); | |
| return () => { | |
| unmount(); | |
| unmountCallback?.(); | |
| }; | |
| }, [callback, libraryContext]); | |
| }; | |
Xet Storage Details
- Size:
- 658 Bytes
- Xet hash:
- 17c4ca0aeaaca6386e67125ada7f23afef3adb1e73c7a4d2f029c5ff64cf3970
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.