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

util-enquire

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

util-enquire

avoid server-side rendering errors.

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7
increased by250%
Maintainers
1
Weekly downloads
 
Created
Source

enquire.js 的二次封装

Build Status Coverage Status

version

v1.0.0
- 初始化

安装

# 安装
npm i util-enquire
# 或者 yarn add util-enquire

util-enquire

import enquireJs from 'enquire.js'
export interface Handler {
	match: () => void
	unmatch: () => void
}
export declare type EnquireScreen = (cb: (isMobile?: boolean) => void, query?: string) => Handler | undefined
export declare type UnenquireScreen = (handler: Handler, query?: string) => void
export declare const enquireScreen: EnquireScreen
export declare const unenquireScreen: UnenquireScreen
export default enquireJs

enquireScreen(cb, query):

nametypedefaultdescription
cbfuncnullcb(boolean), boolean 为 true 则为 mobile
querystringonly screen and (max-width: 767.99px)css 的场景判断

unenquireScrenn(handler, query);

nametypedefaultdescription
handlerobjectnull需要卸载的 enquireScreen 返回 handler;
querystringonly screen and (max-width: 767.99px)css 的场景判断

Keywords

FAQs

Package last updated on 09 Dec 2020

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