Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@faceless-ui/window-info

Package Overview
Dependencies
Maintainers
1
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@faceless-ui/window-info

React utility for subscribing to window events

  • 2.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
67K
increased by13.7%
Maintainers
1
Weekly downloads
 
Created
Source

NPM Bundle Size Supported by TRBL

React Window Info

A utility for subscribing to window events. Useful for conditional rendering, CSS breakpoints, or any window-based triggers.

Highlights

  • Event Consolidation

    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.

  • Animation Ready

    Piped through requestAnimationFrame for built-in throttling and debouncing.

Quick Start

Installation

$ npm i @faceless-ui/window-info
$ # or
$ yarn add @faceless-ui/window-info

Composition

  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.

Demo

$ git clone git@github.com:faceless-ui/window-info.git
$ yarn
$ yarn dev
$ open http://localhost:3000

API

Contribution

Help us, or let us help you help us.

License

MIT Copyright (c) TRBL, LLC

Keywords

FAQs

Package last updated on 07 May 2021

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc