mirror of
https://github.com/pezkuwichain/pezkuwi-apps.git
synced 2026-04-23 02:27:57 +00:00
16 lines
470 B
TypeScript
16 lines
470 B
TypeScript
// Copyright 2017-2026 @pezkuwi/react-hooks authors & contributors
|
|
// SPDX-License-Identifier: Apache-2.0
|
|
|
|
import type { WindowSize } from './ctx/types.js';
|
|
|
|
import { useContext } from 'react';
|
|
|
|
import { WindowSizeCtx } from './ctx/WindowSize.js';
|
|
import { createNamedHook } from './createNamedHook.js';
|
|
|
|
function useWindowSizeImpl (): WindowSize {
|
|
return useContext(WindowSizeCtx);
|
|
}
|
|
|
|
export const useWindowSize = createNamedHook('useWindowSize', useWindowSizeImpl);
|