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

@quilted/events

Package Overview
Dependencies
Maintainers
1
Versions
53
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@quilted/events - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

5

build/typescript/emitter.d.ts
import type { AbortBehavior } from './abort';
export declare type EmitterEventType = string | symbol;
export declare type EmitterHandler<T = unknown> = (event: T) => void;
export interface Emitter<Events extends Record<EmitterEventType, unknown>> {
export interface Emitter<Events = {}> {
on<Event extends keyof Events>(type: Event, handler: EmitterHandler<Events[Event]>, options?: {

@@ -28,3 +27,3 @@ once?: boolean;

}
export declare function createEmitter<Events extends Record<EmitterEventType, unknown>>(): Emitter<Events>;
export declare function createEmitter<Events = {}>(): Emitter<Events>;
//# sourceMappingURL=emitter.d.ts.map

2

build/typescript/index.d.ts

@@ -6,4 +6,4 @@ export { on } from './on';

export { createEmitter } from './emitter';
export type { Emitter, EmitterHandler, EmitterEventType } from './emitter';
export type { Emitter, EmitterHandler } from './emitter';
export type { EventTarget, EventTargetOn, EventTargetAddEventListener, EventTargetFunction, } from './types';
//# sourceMappingURL=index.d.ts.map
# @quilted/events
## 0.1.2
### Patch Changes
- [`f88502ca`](https://github.com/lemonmade/quilt/commit/f88502ca8c969d0da0991523cb1326c9fd6d2203) Thanks [@lemonmade](https://github.com/lemonmade)! - Fix some events types and exports
## 0.1.1

@@ -4,0 +10,0 @@

@@ -5,3 +5,3 @@ {

"type": "module",
"version": "0.1.1",
"version": "0.1.2",
"license": "MIT",

@@ -8,0 +8,0 @@ "engines": {

@@ -5,6 +5,6 @@ import {on as onEvent} from './on';

export type EmitterEventType = string | symbol;
export type EmitterHandler<T = unknown> = (event: T) => void;
export interface Emitter<Events extends Record<EmitterEventType, unknown>> {
// eslint-disable-next-line @typescript-eslint/ban-types
export interface Emitter<Events = {}> {
on<Event extends keyof Events>(

@@ -36,5 +36,4 @@ type: Event,

export function createEmitter<
Events extends Record<EmitterEventType, unknown>,
>(): Emitter<Events> {
// eslint-disable-next-line @typescript-eslint/ban-types
export function createEmitter<Events = {}>(): Emitter<Events> {
const handlerMap = new Map<keyof Events, Set<any>>();

@@ -75,6 +74,6 @@

let handlers = handlerMap.get(event);
const signalAbort = new AbortController();
const signalAbort = signal && new AbortController();
const remove = () => {
signalAbort.abort();
signalAbort?.abort();
handlers!.delete(normalizedHandler);

@@ -98,4 +97,4 @@ };

signal?.addEventListener('abort', remove, {signal: signalAbort.signal});
signal?.addEventListener('abort', remove, {signal: signalAbort!.signal});
}
}

@@ -6,3 +6,3 @@ export {on} from './on';

export {createEmitter} from './emitter';
export type {Emitter, EmitterHandler, EmitterEventType} from './emitter';
export type {Emitter, EmitterHandler} from './emitter';
export type {

@@ -9,0 +9,0 @@ EventTarget,

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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