Files
suwayomi-material-you-webui/src/modules/reader/contexts/ReaderAutoScrollContext.tsx

20 lines
666 B
TypeScript
Raw Normal View History

2024-12-27 00:30:19 +01:00
/*
* Copyright (C) Contributors to the Suwayomi project
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
import { createContext, useContext } from 'react';
import { TReaderAutoScrollContext } from '@/modules/reader/types/Reader.types.ts';
export const ReaderAutoScrollContext = createContext<TReaderAutoScrollContext>({
isActive: false,
setScrollRef: () => {},
start: () => {},
cancel: () => {},
});
export const useReaderAutoScrollContext = () => useContext(ReaderAutoScrollContext);