Socket
Socket
Sign inDemoInstall

@effection/events

Package Overview
Dependencies
Maintainers
1
Versions
158
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@effection/events - npm Package Compare versions

Comparing version 0.6.1-d4080d7 to 0.6.1-fe35037

dist/events.cjs.development.js

0

dist/event-source.d.ts

@@ -0,0 +0,0 @@ /// <reference types="node" />

@@ -0,0 +0,0 @@ export { once } from './once';

18

dist/index.js

@@ -1,10 +0,8 @@

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var once_1 = require("./once");
exports.once = once_1.once;
var on_1 = require("./on");
exports.on = on_1.on;
exports.Subscription = on_1.Subscription;
var throw_on_error_event_1 = require("./throw-on-error-event");
exports.throwOnErrorEvent = throw_on_error_event_1.throwOnErrorEvent;
//# sourceMappingURL=index.js.map
'use strict'
if (process.env.NODE_ENV === 'production') {
module.exports = require('./events.cjs.production.min.js')
} else {
module.exports = require('./events.cjs.development.js')
}

@@ -0,0 +0,0 @@ import { Operation } from 'effection';

@@ -0,0 +0,0 @@ import { Operation } from 'effection';

import { EventSource } from './event-source';
import { Operation } from 'effection';
export declare function throwOnErrorEvent(source: EventSource): Operation<void>;
{
"name": "@effection/events",
"version": "0.6.1-d4080d7",
"version": "0.6.1-fe35037",
"description": "Helpers for listening to events with effection",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"module": "dist/events.esm.js",
"repository": "https://github.com/thefrontside/bigtest.git",

@@ -18,3 +19,3 @@ "author": "Frontside Engineering <engineering@frontside.io>",

"test": "mocha -r ts-node/register test/**/*.test.ts",
"prepack": "tsc --outdir dist --project tsconfig.dist.json",
"prepack": "tsdx build --tsconfig tsconfig.dist.json",
"mocha": "mocha -r ts-node/register"

@@ -28,2 +29,3 @@ },

"ts-node": "^8.9.0",
"tsdx": "0.13.2",
"typescript": "^3.7.0"

@@ -30,0 +32,0 @@ },

@@ -5,6 +5,2 @@ import { resource, Operation } from 'effection';

function isNotEmpty<T>(array: T[]): array is { shift(): T; } & Array<T> {
return array.length > 0;
}
export class Subscription<T extends Array<unknown>> {

@@ -17,4 +13,6 @@ private events: T[] = [];

while(true) {
if (isNotEmpty(this.events)) {
return this.events.shift();
let [event, ...events] = this.events;
if (event) {
this.events = events;
return event;
}

@@ -21,0 +19,0 @@ yield once(this.source, this.eventName);

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