diff --git a/src/components/listing-image-gallery/utils/useLastViewedPhoto.ts b/src/components/listing-image-gallery/utils/useLastViewedPhoto.ts new file mode 100644 index 0000000..7f49272 --- /dev/null +++ b/src/components/listing-image-gallery/utils/useLastViewedPhoto.ts @@ -0,0 +1,8 @@ +import { createGlobalState } from 'react-hooks-global-state' + +const initialState = { photoToScrollTo: null } +const { useGlobalState } = createGlobalState(initialState) + +export const useLastViewedPhoto = () => { + return useGlobalState('photoToScrollTo') +}