Skip to content

Commit

Permalink
chore: update p-event to version 3.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
raymondfeng committed Mar 2, 2019
1 parent 24cd683 commit 6bdbbcc
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 19 deletions.
2 changes: 1 addition & 1 deletion benchmark/package.json
Expand Up @@ -55,7 +55,7 @@
"@types/mocha": "^5.0.0",
"@types/node": "^10.11.2",
"mocha": "^6.0.0",
"p-event": "^2.3.1",
"p-event": "^3.0.0",
"source-map-support": "^0.5.5"
}
}
2 changes: 1 addition & 1 deletion benchmark/src/benchmark.ts
Expand Up @@ -5,7 +5,7 @@

import * as byline from 'byline';
import {ChildProcess, spawn} from 'child_process';
import * as pEvent from 'p-event';
import pEvent from 'p-event';
import {Autocannon, EndpointStats} from './autocannon';
import {Client} from './client';
import {scenarios} from './scenarios';
Expand Down
2 changes: 1 addition & 1 deletion docs/site/express-with-lb4-rest-tutorial.md
Expand Up @@ -219,7 +219,7 @@ Finally, we can add functions to boot the `Note` application and start the
Express application:

```ts
import * as pEvent from 'p-event';
import pEvent from 'p-event';

export class ExpressServer {
private app: express.Application;
Expand Down
2 changes: 1 addition & 1 deletion examples/express-composition/package.json
Expand Up @@ -60,7 +60,7 @@
"@loopback/rest-explorer": "^1.1.10",
"@loopback/service-proxy": "^1.0.9",
"express": "^4.16.4",
"p-event": "^2.3.1"
"p-event": "^3.0.0"
},
"devDependencies": {
"@loopback/build": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/express-composition/src/server.ts
Expand Up @@ -3,7 +3,7 @@ import {ApplicationConfig} from '@loopback/core';
import {Request, Response} from 'express';
import * as express from 'express';
import * as path from 'path';
import * as pEvent from 'p-event';
import pEvent from 'p-event';
import * as http from 'http';

export class ExpressServer {
Expand Down
2 changes: 1 addition & 1 deletion examples/rpc-server/package.json
Expand Up @@ -41,7 +41,7 @@
"@loopback/context": "^1.6.0",
"@loopback/core": "^1.1.7",
"express": "^4.16.3",
"p-event": "^2.3.1"
"p-event": "^3.0.0"
},
"devDependencies": {
"@loopback/build": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/rpc-server/src/rpc.server.ts
Expand Up @@ -7,7 +7,7 @@ import {inject, Context} from '@loopback/context';
import {Server, Application, CoreBindings} from '@loopback/core';
import * as express from 'express';
import * as http from 'http';
import * as pEvent from 'p-event';
import pEvent from 'p-event';
import {rpcRouter} from './rpc.router';

export class RPCServer extends Context implements Server {
Expand Down
2 changes: 1 addition & 1 deletion packages/context/package.json
Expand Up @@ -21,7 +21,7 @@
"dependencies": {
"@loopback/metadata": "^1.0.7",
"debug": "^4.0.1",
"p-event": "^2.3.1",
"p-event": "^3.0.0",
"uuid": "^3.2.1"
},
"devDependencies": {
Expand Down
Expand Up @@ -4,6 +4,7 @@
// License text available at https://opensource.org/licenses/MIT

import {expect} from '@loopback/testlab';
import pEvent from 'p-event';
import {promisify} from 'util';
import {
Binding,
Expand All @@ -13,7 +14,6 @@ import {
filterByTag,
} from '../..';

const pEvent = require('p-event');
const setImmediateAsync = promisify(setImmediate);

/**
Expand Down
9 changes: 4 additions & 5 deletions packages/context/src/context.ts
Expand Up @@ -5,6 +5,8 @@

import * as debugModule from 'debug';
import {EventEmitter} from 'events';
import pEvent from 'p-event';
import {iterator, multiple} from 'p-event';
import {v1 as uuidv1} from 'uuid';
import {ValueOrPromise} from '.';
import {Binding, BindingTag} from './binding';
Expand All @@ -29,9 +31,6 @@ if (!Symbol.asyncIterator) {
(Symbol as any).asyncIterator = Symbol.for('Symbol.asyncIterator');
}

// FIXME: `@types/p-event` is out of date against `p-event@2.2.0`
const pEvent = require('p-event');

const debug = debugModule('loopback:context');

/**
Expand Down Expand Up @@ -229,7 +228,7 @@ export class Context extends EventEmitter {
this.setupNotification('bind', 'unbind');

// Create an async iterator for the `notification` event as a queue
this.notificationQueue = pEvent.iterator(this, 'notification');
this.notificationQueue = iterator(this, 'notification');

return this.processNotifications();
}
Expand Down Expand Up @@ -297,7 +296,7 @@ export class Context extends EventEmitter {
protected async waitUntilPendingNotificationsDone(timeout?: number) {
const count = this.pendingNotifications;
if (count === 0) return;
await pEvent.multiple(this, 'observersNotified', {count, timeout});
await multiple(this, 'observersNotified', {count, timeout});
}

/**
Expand Down
2 changes: 1 addition & 1 deletion packages/http-caching-proxy/package.json
Expand Up @@ -19,7 +19,7 @@
"dependencies": {
"cacache": "^11.0.2",
"debug": "^4.0.1",
"p-event": "^2.3.1",
"p-event": "^3.0.0",
"request": "^2.87.0",
"request-promise-native": "^1.0.5",
"rimraf": "^2.6.2"
Expand Down
Expand Up @@ -7,7 +7,7 @@ import {expect} from '@loopback/testlab';
import delay from 'delay';
import * as http from 'http';
import {AddressInfo} from 'net';
import * as pEvent from 'p-event';
import pEvent from 'p-event';
import * as path from 'path';
import * as makeRequest from 'request-promise-native';
import * as rimrafCb from 'rimraf';
Expand Down
2 changes: 1 addition & 1 deletion packages/http-caching-proxy/src/http-caching-proxy.ts
Expand Up @@ -12,7 +12,7 @@ import {
createServer,
} from 'http';
import {AddressInfo} from 'net';
import * as pEvent from 'p-event';
import pEvent from 'p-event';
import * as makeRequest from 'request-promise-native';

const cacache = require('cacache');
Expand Down
2 changes: 1 addition & 1 deletion packages/http-server/package.json
Expand Up @@ -17,7 +17,7 @@
"copyright.owner": "IBM Corp.",
"license": "MIT",
"dependencies": {
"p-event": "^2.3.1"
"p-event": "^3.0.0"
},
"devDependencies": {
"@loopback/build": "^1.3.1",
Expand Down
2 changes: 1 addition & 1 deletion packages/http-server/src/http-server.ts
Expand Up @@ -8,7 +8,7 @@ import * as http from 'http';
import * as https from 'https';
import {AddressInfo} from 'net';

import * as pEvent from 'p-event';
import pEvent from 'p-event';

export type RequestListener = (
req: IncomingMessage,
Expand Down

0 comments on commit 6bdbbcc

Please sign in to comment.