@graphql-yoga/subscription 5.0.1 → 5.0.2-alpha-20240728232210-e814a390

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createPubSub = void 0;
4
4
  const repeater_1 = require("@repeaterjs/repeater");
5
- const events_1 = require("@whatwg-node/events");
6
5
  /**
7
6
  * Utility for publishing and subscribing to events.
8
7
  */
@@ -12,7 +11,7 @@ const createPubSub = (config) => {
12
11
  publish(routingKey, ...args) {
13
12
  const payload = args[1] ?? args[0] ?? null;
14
13
  const topic = args[1] === undefined ? routingKey : `${routingKey}:${args[0]}`;
15
- const event = new events_1.CustomEvent(topic, {
14
+ const event = new CustomEvent(topic, {
16
15
  detail: payload,
17
16
  });
18
17
  target.dispatchEvent(event);
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.filter = void 0;
3
+ exports.filter = filter;
4
4
  const repeater_1 = require("@repeaterjs/repeater");
5
5
  function filter(filter) {
6
6
  return (source) => new repeater_1.Repeater(async (push, stop) => {
@@ -17,4 +17,3 @@ function filter(filter) {
17
17
  stop();
18
18
  });
19
19
  }
20
- exports.filter = filter;
package/cjs/utils/pipe.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.pipe = void 0;
3
+ exports.pipe = pipe;
4
4
  function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
5
5
  switch (arguments.length) {
6
6
  case 1:
@@ -31,4 +31,3 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
31
31
  return ret;
32
32
  }
33
33
  }
34
- exports.pipe = pipe;
@@ -1,5 +1,4 @@
1
1
  import { Repeater } from '@repeaterjs/repeater';
2
- import { CustomEvent } from '@whatwg-node/events';
3
2
  /**
4
3
  * Utility for publishing and subscribing to events.
5
4
  */
package/package.json CHANGED
@@ -1,11 +1,10 @@
1
1
  {
2
2
  "name": "@graphql-yoga/subscription",
3
- "version": "5.0.1",
3
+ "version": "5.0.2-alpha-20240728232210-e814a390",
4
4
  "description": "",
5
5
  "sideEffects": true,
6
6
  "dependencies": {
7
7
  "@repeaterjs/repeater": "^3.0.4",
8
- "@whatwg-node/events": "^0.1.0",
9
8
  "tslib": "^2.5.2",
10
9
  "@graphql-yoga/typed-event-target": "^3.0.0"
11
10
  },
@@ -28,5 +28,5 @@ export type PubSub<TPubSubPublishArgsByKey extends PubSubPublishArgsByKey> = {
28
28
  /**
29
29
  * Utility for publishing and subscribing to events.
30
30
  */
31
- export declare const createPubSub: <TPubSubPublishArgsByKey extends PubSubPublishArgsByKey>(config?: ChannelPubSubConfig<TPubSubPublishArgsByKey> | undefined) => PubSub<TPubSubPublishArgsByKey>;
31
+ export declare const createPubSub: <TPubSubPublishArgsByKey extends PubSubPublishArgsByKey>(config?: ChannelPubSubConfig<TPubSubPublishArgsByKey>) => PubSub<TPubSubPublishArgsByKey>;
32
32
  export {};
@@ -28,5 +28,5 @@ export type PubSub<TPubSubPublishArgsByKey extends PubSubPublishArgsByKey> = {
28
28
  /**
29
29
  * Utility for publishing and subscribing to events.
30
30
  */
31
- export declare const createPubSub: <TPubSubPublishArgsByKey extends PubSubPublishArgsByKey>(config?: ChannelPubSubConfig<TPubSubPublishArgsByKey> | undefined) => PubSub<TPubSubPublishArgsByKey>;
31
+ export declare const createPubSub: <TPubSubPublishArgsByKey extends PubSubPublishArgsByKey>(config?: ChannelPubSubConfig<TPubSubPublishArgsByKey>) => PubSub<TPubSubPublishArgsByKey>;
32
32
  export {};
@@ -2,4 +2,4 @@ import { Repeater } from '@repeaterjs/repeater';
2
2
  /**
3
3
  * Utility for mapping an event stream.
4
4
  */
5
- export declare const map: <T, O>(mapper: (input: T) => O | Promise<O>) => (source: AsyncIterable<T>) => Repeater<O, any, unknown>;
5
+ export declare const map: <T, O>(mapper: (input: T) => Promise<O> | O) => (source: AsyncIterable<T>) => Repeater<O>;
@@ -2,4 +2,4 @@ import { Repeater } from '@repeaterjs/repeater';
2
2
  /**
3
3
  * Utility for mapping an event stream.
4
4
  */
5
- export declare const map: <T, O>(mapper: (input: T) => O | Promise<O>) => (source: AsyncIterable<T>) => Repeater<O, any, unknown>;
5
+ export declare const map: <T, O>(mapper: (input: T) => Promise<O> | O) => (source: AsyncIterable<T>) => Repeater<O>;