@graphql-yoga/subscription 0.1.0-alpha.0 → 0.2.0-canary-e1dfc9e.0

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.
package/index.d.ts CHANGED
@@ -1,4 +1,6 @@
1
+ export { Repeater } from '@repeaterjs/repeater';
1
2
  export { createPubSub } from './createPubSub';
2
3
  export type { PubSubEventTarget, PubSubEvent } from './createPubSub';
3
4
  export { map } from './operator/map';
4
5
  export { filter } from './operator/filter';
6
+ export { pipe } from './utils/pipe';
package/index.js CHANGED
@@ -81,6 +81,42 @@ function filter(filter) {
81
81
  });
82
82
  }
83
83
 
84
+ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
85
+ switch (arguments.length) {
86
+ case 1:
87
+ return a;
88
+ case 2:
89
+ return ab(a);
90
+ case 3:
91
+ return bc(ab(a));
92
+ case 4:
93
+ return cd(bc(ab(a)));
94
+ case 5:
95
+ return de(cd(bc(ab(a))));
96
+ case 6:
97
+ return ef(de(cd(bc(ab(a)))));
98
+ case 7:
99
+ return fg(ef(de(cd(bc(ab(a))))));
100
+ case 8:
101
+ return gh(fg(ef(de(cd(bc(ab(a)))))));
102
+ case 9:
103
+ return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
104
+ default:
105
+ let ret = arguments[0];
106
+ for (let i = 1; i < arguments.length; i++) {
107
+ ret = arguments[i](ret);
108
+ }
109
+ return ret;
110
+ }
111
+ }
112
+
113
+ Object.defineProperty(exports, 'Repeater', {
114
+ enumerable: true,
115
+ get: function () {
116
+ return repeater.Repeater;
117
+ }
118
+ });
84
119
  exports.createPubSub = createPubSub;
85
120
  exports.filter = filter;
86
121
  exports.map = map;
122
+ exports.pipe = pipe;
package/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Repeater } from '@repeaterjs/repeater';
2
+ export { Repeater } from '@repeaterjs/repeater';
2
3
 
3
4
  const resolveGlobalConfig = (api = globalThis) => {
4
5
  if (!api.Event || !api.EventTarget) {
@@ -77,4 +78,33 @@ function filter(filter) {
77
78
  });
78
79
  }
79
80
 
80
- export { createPubSub, filter, map };
81
+ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
82
+ switch (arguments.length) {
83
+ case 1:
84
+ return a;
85
+ case 2:
86
+ return ab(a);
87
+ case 3:
88
+ return bc(ab(a));
89
+ case 4:
90
+ return cd(bc(ab(a)));
91
+ case 5:
92
+ return de(cd(bc(ab(a))));
93
+ case 6:
94
+ return ef(de(cd(bc(ab(a)))));
95
+ case 7:
96
+ return fg(ef(de(cd(bc(ab(a))))));
97
+ case 8:
98
+ return gh(fg(ef(de(cd(bc(ab(a)))))));
99
+ case 9:
100
+ return hi(gh(fg(ef(de(cd(bc(ab(a))))))));
101
+ default:
102
+ let ret = arguments[0];
103
+ for (let i = 1; i < arguments.length; i++) {
104
+ ret = arguments[i](ret);
105
+ }
106
+ return ret;
107
+ }
108
+ }
109
+
110
+ export { createPubSub, filter, map, pipe };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graphql-yoga/subscription",
3
- "version": "0.1.0-alpha.0",
3
+ "version": "0.2.0-canary-e1dfc9e.0",
4
4
  "description": "",
5
5
  "dependencies": {
6
6
  "@repeaterjs/repeater": "^3.0.4"
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Pipes the value of an expression into a pipeline of functions.
3
+ *
4
+ * @source https://github.com/gcanti/fp-ts/blob/b442f0967b002b88eb2649ba38d95ec5ad2ab576/src/function.ts#L391-L682
5
+ */
6
+ export declare function pipe<A>(a: A): A;
7
+ export declare function pipe<A, B>(a: A, ab: (a: A) => B): B;
8
+ export declare function pipe<A, B, C>(a: A, ab: (a: A) => B, bc: (b: B) => C): C;
9
+ export declare function pipe<A, B, C, D>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D): D;
10
+ export declare function pipe<A, B, C, D, E>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E): E;
11
+ export declare function pipe<A, B, C, D, E, F>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F): F;
12
+ export declare function pipe<A, B, C, D, E, F, G>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G): G;
13
+ export declare function pipe<A, B, C, D, E, F, G, H>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H): H;
14
+ export declare function pipe<A, B, C, D, E, F, G, H, I>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I): I;
15
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J): J;
16
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K): K;
17
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L): L;
18
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M): M;
19
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N): N;
20
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O): O;
21
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P): P;
22
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P, pq: (p: P) => Q): Q;
23
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P, pq: (p: P) => Q, qr: (q: Q) => R): R;
24
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P, pq: (p: P) => Q, qr: (q: Q) => R, rs: (r: R) => S): S;
25
+ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(a: A, ab: (a: A) => B, bc: (b: B) => C, cd: (c: C) => D, de: (d: D) => E, ef: (e: E) => F, fg: (f: F) => G, gh: (g: G) => H, hi: (h: H) => I, ij: (i: I) => J, jk: (j: J) => K, kl: (k: K) => L, lm: (l: L) => M, mn: (m: M) => N, no: (n: N) => O, op: (o: O) => P, pq: (p: P) => Q, qr: (q: Q) => R, rs: (r: R) => S, st: (s: S) => T): T;