
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
@faceless-ui/window-info
Advanced tools
A utility for subscribing to window events. Useful for conditional rendering, CSS breakpoints, or any window-based triggers.
One event, many effects. Attach one, single event listener to the window with WindowInfoProvider. Then subscribe to it from anywhere with useWindowInfo, withWindowInfo, or WindowInfo, they all do the same thing.
Piped through requestAnimationFrame for built-in throttling and debouncing.
$ npm i @faceless-ui/window-info
$ # or
$ yarn add @faceless-ui/window-info
import React from 'react';
import {
WindowInfo,
WindowInfoProvider,
withWindowInfo,
useWindowInfo
} from '@faceless-ui/window-info';
const WithWindowInfo = withWindowInfo(({ windowInfo }) => <div>{windowInfo}</div>);
const UseWindowInfo = () => <div>{useWindowInfo()}</div>;
const App = () => (
<WindowInfoProvider>
<WithWindowInfo />
<UseWindowInfo />
<WindowInfo>
{(windowInfo) => <div>{windowInfo}</div>}
<WindowInfo>
</WindowInfoProvider>
);
export default App;
For working examples, see the demo app.
$ git clone git@github.com:faceless-ui/window-info.git
$ yarn
$ yarn dev
$ open http://localhost:3000
Help us, or let us help you help us.
MIT Copyright (c) TRBL, LLC
FAQs
A React library for subscribing to window events
The npm package @faceless-ui/window-info receives a total of 51,999 weekly downloads. As such, @faceless-ui/window-info popularity was classified as popular.
We found that @faceless-ui/window-info demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.