Socket
Book a DemoInstallSign in
Socket

awaited-event

Package Overview
Dependencies
Maintainers
0
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
Package was removed
Sorry, it seems this package was removed from the registry

awaited-event

Await your DOM Event

unpublished
latest
Source
npmnpm
Version
0.0.2
Version published
Maintainers
0
Created
Source

Awaited Event

async / await 化 DOM 事件监听的极简实现,类型完备。

import { on } from "awaited-event";

const el = document.querySelector(".foo") as HTMLElement;
const event = await on(el, "click");

第一个参数 extendEventTarget,只要它含有形如 on${string}: (event: any) => any 的键值对,都能被此工具函数提取到对应的类型。

FAQs

Package last updated on 29 Jun 2024

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