@trpc/server 11.24.0 → 11.24.1-canary.2.c7a2144c5
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/README.md +56 -0
- package/dist/adapters/aws-lambda/index.cjs +1 -1
- package/dist/adapters/aws-lambda/index.d.cts +1 -1
- package/dist/adapters/aws-lambda/index.d.mts +1 -1
- package/dist/adapters/aws-lambda/index.mjs +1 -1
- package/dist/adapters/express.cjs +1 -1
- package/dist/adapters/express.d.cts +2 -2
- package/dist/adapters/express.d.mts +2 -2
- package/dist/adapters/express.mjs +1 -1
- package/dist/adapters/fastify/index.cjs +3 -3
- package/dist/adapters/fastify/index.d.cts +3 -3
- package/dist/adapters/fastify/index.d.mts +3 -3
- package/dist/adapters/fastify/index.mjs +3 -3
- package/dist/adapters/fetch/index.cjs +1 -1
- package/dist/adapters/fetch/index.d.cts +1 -1
- package/dist/adapters/fetch/index.d.mts +1 -1
- package/dist/adapters/fetch/index.mjs +1 -1
- package/dist/adapters/next-app-dir.d.cts +1 -1
- package/dist/adapters/next-app-dir.d.mts +1 -1
- package/dist/adapters/next.cjs +1 -1
- package/dist/adapters/next.d.cts +2 -2
- package/dist/adapters/next.d.mts +2 -2
- package/dist/adapters/next.mjs +1 -1
- package/dist/adapters/node-http/index.cjs +1 -1
- package/dist/adapters/node-http/index.d.cts +1 -1
- package/dist/adapters/node-http/index.d.mts +1 -1
- package/dist/adapters/node-http/index.mjs +1 -1
- package/dist/adapters/standalone.cjs +1 -1
- package/dist/adapters/standalone.d.cts +2 -2
- package/dist/adapters/standalone.d.mts +2 -2
- package/dist/adapters/standalone.mjs +1 -1
- package/dist/adapters/ws.cjs +1 -1
- package/dist/adapters/ws.d.cts +2 -2
- package/dist/adapters/ws.d.mts +2 -2
- package/dist/adapters/ws.mjs +1 -1
- package/dist/http.cjs +1 -1
- package/dist/http.d.cts +1 -1
- package/dist/http.d.mts +1 -1
- package/dist/http.mjs +1 -1
- package/dist/{index-BGYvuCEh.d.cts → index-DIc3RMYq.d.cts} +6 -3
- package/dist/{index-BGYvuCEh.d.cts.map → index-DIc3RMYq.d.cts.map} +1 -1
- package/dist/{index-BGYvuCEh.d.mts → index-DIc3RMYq.d.mts} +6 -3
- package/dist/{index-BGYvuCEh.d.mts.map → index-DIc3RMYq.d.mts.map} +1 -1
- package/dist/{index-BHT7qMyI.d.mts → index-DXOA7HZX.d.cts} +2 -2
- package/dist/{index-BHT7qMyI.d.mts.map → index-DXOA7HZX.d.cts.map} +1 -1
- package/dist/{index-CJbDjPDQ.d.cts → index-yEUjMWq0.d.mts} +2 -2
- package/dist/{index-CJbDjPDQ.d.cts.map → index-yEUjMWq0.d.mts.map} +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{initTRPC-DZEOtiNy.cjs → initTRPC-Cra_OZpb.cjs} +1 -1
- package/dist/{initTRPC-D-7sLVWc.mjs → initTRPC-D2bGKLkU.mjs} +2 -2
- package/dist/{initTRPC-D-7sLVWc.mjs.map → initTRPC-D2bGKLkU.mjs.map} +1 -1
- package/dist/{node-http-fnRXnfX7.cjs → node-http-Bq8c5wbG.cjs} +1 -1
- package/dist/{node-http-BHs4hFcB.mjs → node-http-DX50OxnV.mjs} +2 -2
- package/dist/{node-http-BHs4hFcB.mjs.map → node-http-DX50OxnV.mjs.map} +1 -1
- package/dist/observable/index.cjs +2 -2
- package/dist/observable/index.d.cts +1 -1
- package/dist/observable/index.d.mts +1 -1
- package/dist/observable/index.mjs +2 -2
- package/dist/{observable-B8nn0anr.cjs → observable-C-kLxTDb.cjs} +62 -48
- package/dist/{observable-DMA7fHJ6.mjs → observable-C3JLK4qJ.mjs} +2 -2
- package/dist/{observable-DMA7fHJ6.mjs.map → observable-C3JLK4qJ.mjs.map} +1 -1
- package/dist/{observable-CdPmrXKY.mjs → observable-DvsUkNRH.mjs} +63 -49
- package/dist/observable-DvsUkNRH.mjs.map +1 -0
- package/dist/{observable-DJG_yLnF.cjs → observable-ljzQ36vj.cjs} +1 -1
- package/dist/{resolveResponse-BLSF4Ks0.cjs → resolveResponse-CPinar9Q.cjs} +1 -1
- package/dist/{resolveResponse-BDxeIDKz.mjs → resolveResponse-F8DsMtod.mjs} +2 -2
- package/dist/{resolveResponse-BDxeIDKz.mjs.map → resolveResponse-F8DsMtod.mjs.map} +1 -1
- package/dist/rpc.d.cts +1 -1
- package/dist/rpc.d.mts +1 -1
- package/dist/shared.d.cts +1 -1
- package/dist/shared.d.mts +1 -1
- package/dist/{unstable-core-do-not-import-BAX_ZNHT.d.cts → unstable-core-do-not-import-BcPWhI2Q.d.cts} +2 -2
- package/dist/{unstable-core-do-not-import-OfjMxw-0.d.mts.map → unstable-core-do-not-import-BcPWhI2Q.d.cts.map} +1 -1
- package/dist/{unstable-core-do-not-import-OfjMxw-0.d.mts → unstable-core-do-not-import-ia0QlnhQ.d.mts} +2 -2
- package/dist/{unstable-core-do-not-import-BAX_ZNHT.d.cts.map → unstable-core-do-not-import-ia0QlnhQ.d.mts.map} +1 -1
- package/dist/unstable-core-do-not-import.cjs +2 -2
- package/dist/unstable-core-do-not-import.d.cts +1 -1
- package/dist/unstable-core-do-not-import.d.mts +1 -1
- package/dist/unstable-core-do-not-import.mjs +2 -2
- package/dist/{ws-CA_yykwZ.d.mts → ws-BgubbdBw.d.cts} +3 -3
- package/dist/{ws-C6aokjeu.d.cts.map → ws-BgubbdBw.d.cts.map} +1 -1
- package/dist/{ws-D8h4AHV-.cjs → ws-CuH1cMuq.cjs} +3 -3
- package/dist/{ws-C6aokjeu.d.cts → ws-DHvOQ0WH.d.mts} +3 -3
- package/dist/{ws-CA_yykwZ.d.mts.map → ws-DHvOQ0WH.d.mts.map} +1 -1
- package/dist/{ws-BY66ccWn.mjs → ws-PNlb0-d5.mjs} +4 -4
- package/dist/{ws-BY66ccWn.mjs.map → ws-PNlb0-d5.mjs.map} +1 -1
- package/package.json +2 -2
- package/skills/adapter-aws-lambda/SKILL.md +1 -1
- package/skills/adapter-express/SKILL.md +1 -1
- package/skills/adapter-fastify/SKILL.md +1 -1
- package/skills/adapter-fetch/SKILL.md +1 -1
- package/skills/adapter-standalone/SKILL.md +1 -1
- package/skills/auth/SKILL.md +1 -1
- package/skills/caching/SKILL.md +1 -1
- package/skills/error-handling/SKILL.md +1 -1
- package/skills/middlewares/SKILL.md +1 -1
- package/skills/non-json-content-types/SKILL.md +1 -1
- package/skills/server-setup/SKILL.md +1 -1
- package/skills/server-side-calls/SKILL.md +1 -1
- package/skills/service-oriented-architecture/SKILL.md +1 -1
- package/skills/subscriptions/SKILL.md +1 -1
- package/skills/trpc-router/SKILL.md +1 -1
- package/skills/validators/SKILL.md +1 -1
- package/src/observable/observable.ts +73 -60
- package/dist/observable-CdPmrXKY.mjs.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"observable-DMA7fHJ6.mjs","names":[],"sources":["../src/observable/operators.ts","../src/observable/behaviorSubject.ts"],"sourcesContent":["import { observable } from './observable';\nimport type {\n MonoTypeOperatorFunction,\n Observer,\n OperatorFunction,\n Unsubscribable,\n} from './types';\n\n/** Maps each value with `project`. */\nexport function map<TValueBefore, TError, TValueAfter>(\n project: (value: TValueBefore, index: number) => TValueAfter,\n): OperatorFunction<TValueBefore, TError, TValueAfter, TError> {\n return (source) => {\n return observable((destination) => {\n let index = 0;\n const subscription = source.subscribe({\n next(value) {\n destination.next(project(value, index++));\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n return subscription;\n });\n };\n}\n\ninterface ShareConfig {}\n/**\n * Shares one subscription to the source between all subscribers. It\n * starts with the first subscriber and ends when the last unsubscribes.\n */\nexport function share<TValue, TError>(\n _opts?: ShareConfig,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n let refCount = 0;\n\n let subscription: Unsubscribable | null = null;\n // True while `source.subscribe` runs, so subscribers added by a synchronous\n // `next` join the starting source instead of starting another one\n let isConnecting = false;\n let observers = new Set<Partial<Observer<TValue, TError>>>();\n\n function startIfNeeded() {\n if (subscription || isConnecting) {\n return;\n }\n isConnecting = true;\n let isDone = false;\n let sourceSubscription: Unsubscribable;\n try {\n sourceSubscription = source.subscribe({\n next(value) {\n notify(observers, (observer) => observer.next?.(value));\n },\n error(error) {\n isDone = true;\n terminate((observer) => observer.error?.(error));\n },\n complete() {\n isDone = true;\n terminate((observer) => observer.complete?.());\n },\n });\n } finally {\n isConnecting = false;\n }\n // A synchronous terminal event fires before `subscribe` returns, and its\n // callbacks may already have started a new source\n if (isDone) {\n sourceSubscription.unsubscribe();\n } else {\n subscription = sourceSubscription;\n }\n }\n function notify(\n targets: Set<Partial<Observer<TValue, TError>>>,\n callback: (observer: Partial<Observer<TValue, TError>>) => void,\n ) {\n for (const observer of [...targets]) {\n if (targets.has(observer)) {\n callback(observer);\n }\n }\n }\n function terminate(\n callback: (observer: Partial<Observer<TValue, TError>>) => void,\n ) {\n // Cleared before notifying so a subscriber added during the callback\n // starts a fresh source whose events reach only the observers that\n // joined it; the old source is torn down only after every observer has\n // been notified, mirroring subscription order.\n const _sub = subscription;\n const terminatedObservers = observers;\n subscription = null;\n observers = new Set();\n isConnecting = false;\n try {\n notify(terminatedObservers, callback);\n } finally {\n _sub?.unsubscribe();\n }\n }\n function resetSource() {\n const _sub = subscription;\n subscription = null;\n _sub?.unsubscribe();\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n resetSource();\n }\n }\n\n return observable((subscriber) => {\n refCount++;\n\n const subscriberObservers = observers;\n subscriberObservers.add(subscriber);\n startIfNeeded();\n return {\n unsubscribe() {\n refCount--;\n resetIfNeeded();\n\n subscriberObservers.delete(subscriber);\n },\n };\n });\n };\n}\n\n/** Calls `observer` with each value, error and completion, and passes them on unchanged. */\nexport function tap<TValue, TError>(\n observer: Partial<Observer<TValue, TError>>,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n return source.subscribe({\n next(value) {\n observer.next?.(value);\n destination.next(value);\n },\n error(error) {\n observer.error?.(error);\n destination.error(error);\n },\n complete() {\n observer.complete?.();\n destination.complete();\n },\n });\n });\n };\n}\n\nconst distinctUnsetMarker = Symbol();\n/** Skips values equal to the one before, by `compare` (`===` by default). */\nexport function distinctUntilChanged<TValue, TError>(\n compare: (a: TValue, b: TValue) => boolean = (a, b) => a === b,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n let lastValue: TValue | typeof distinctUnsetMarker = distinctUnsetMarker;\n\n return source.subscribe({\n next(value) {\n if (lastValue !== distinctUnsetMarker && compare(lastValue, value)) {\n return;\n }\n lastValue = value;\n destination.next(value);\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n });\n };\n}\n\nconst isDeepEqual = <T>(a: T, b: T): boolean => {\n if (a === b) {\n return true;\n }\n const bothAreObjects =\n a && b && typeof a === 'object' && typeof b === 'object';\n\n return (\n !!bothAreObjects &&\n Object.keys(a).length === Object.keys(b).length &&\n Object.entries(a).every(([k, v]) => isDeepEqual(v, b[k as keyof T]))\n );\n};\n/**\n * Skips values equal to the one before, comparing objects and arrays by\n * their own enumerable keys. Objects without such keys, like two `Date`s,\n * always count as equal.\n */\nexport function distinctUntilDeepChanged<\n TValue,\n TError,\n>(): MonoTypeOperatorFunction<TValue, TError> {\n return distinctUntilChanged(isDeepEqual);\n}\n","import { observable } from './observable';\nimport type { Observable, Observer } from './types';\n\n/** An observable that holds a current value. */\nexport interface BehaviorSubject<TValue> extends Observable<TValue, never> {\n observable: Observable<TValue, never>;\n /** Sets the value and sends it to subscribers, if it changed. */\n next: (value: TValue) => void;\n /** The current value. */\n get: () => TValue;\n}\n\n/** A `BehaviorSubject` that can't be set. */\nexport interface ReadonlyBehaviorSubject<TValue> extends Omit<\n BehaviorSubject<TValue>,\n 'next'\n> {}\n\n/**\n * Creates an observable that holds a current value. New subscribers get\n * it right away, unless it's `undefined`.\n * @internal\n */\nexport function behaviorSubject<TValue>(\n initialValue: TValue,\n): BehaviorSubject<TValue> {\n let value: TValue = initialValue;\n\n const observerList = new Set<Observer<TValue, never>>();\n\n const addObserver = (observer: Observer<TValue, never>) => {\n if (value !== undefined) {\n observer.next(value);\n }\n observerList.add(observer);\n };\n const removeObserver = (observer: Observer<TValue, never>) => {\n observerList.delete(observer);\n };\n\n const obs = observable<TValue, never>((observer) => {\n addObserver(observer);\n return () => {\n removeObserver(observer);\n };\n }) as BehaviorSubject<TValue>;\n\n obs.next = (nextValue: TValue) => {\n if (value === nextValue) {\n return;\n }\n value = nextValue;\n // an observer can be removed while this loop is notifying it, and an\n // observer removed by an earlier callback must not be notified\n for (const observer of [...observerList]) {\n if (observerList.has(observer)) {\n observer.next(nextValue);\n }\n }\n };\n\n obs.get = () => value;\n\n return obs;\n}\n"],"mappings":";;;AASA,SAAgB,IACd,SAC6D;CAC7D,QAAQ,WAAW;EACjB,OAAO,YAAY,gBAAgB;GACjC,IAAI,QAAQ;GAYZ,OAXqB,OAAO,UAAU;IACpC,KAAK,OAAO;KACV,YAAY,KAAK,QAAQ,OAAO,OAAO,CAAC;IAC1C;IACA,MAAM,OAAO;KACX,YAAY,MAAM,KAAK;IACzB;IACA,WAAW;KACT,YAAY,SAAS;IACvB;GACF,CACkB;EACpB,CAAC;CACH;AACF;;;;;AAOA,SAAgB,MACd,OAC0C;CAC1C,QAAQ,WAAW;EACjB,IAAI,WAAW;EAEf,IAAI,eAAsC;EAG1C,IAAI,eAAe;EACnB,IAAI,4BAAY,IAAI,IAAuC;EAE3D,SAAS,gBAAgB;GACvB,IAAI,gBAAgB,cAClB;GAEF,eAAe;GACf,IAAI,SAAS;GACb,IAAI;GACJ,IAAI;IACF,qBAAqB,OAAO,UAAU;KACpC,KAAK,OAAO;MACV,OAAO,YAAY,aAAa;;OAAS,QAAA,iBAAA,SAAA,UAAA,QAAA,mBAAA,KAAA,IAAA,KAAA,IA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AA6B;CAEtD,MAAM,eAAe,aAAsC;EACzD,IAAI,UAAU,KAAA,GACZ,SAAS,KAAK,KAAK;EAErB,aAAa,IAAI,QAAQ;CAC3B;CACA,MAAM,kBAAkB,aAAsC;EAC5D,aAAa,OAAO,QAAQ;CAC9B;CAEA,MAAM,MAAM,YAA2B,aAAa;EAClD,YAAY,QAAQ;EACpB,aAAa;GACX,eAAe,QAAQ;EACzB;CACF,CAAC;CAED,IAAI,QAAQ,cAAsB;EAChC,IAAI,UAAU,WACZ;EAEF,QAAQ;EAGR,KAAK,MAAM,YAAY,CAAC,GAAG,YAAY,GACrC,IAAI,aAAa,IAAI,QAAQ,GAC3B,SAAS,KAAK,SAAS;CAG7B;CAEA,IAAI,YAAY;CAEhB,OAAO;AACT"}
|
|
1
|
+
{"version":3,"file":"observable-C3JLK4qJ.mjs","names":[],"sources":["../src/observable/operators.ts","../src/observable/behaviorSubject.ts"],"sourcesContent":["import { observable } from './observable';\nimport type {\n MonoTypeOperatorFunction,\n Observer,\n OperatorFunction,\n Unsubscribable,\n} from './types';\n\n/** Maps each value with `project`. */\nexport function map<TValueBefore, TError, TValueAfter>(\n project: (value: TValueBefore, index: number) => TValueAfter,\n): OperatorFunction<TValueBefore, TError, TValueAfter, TError> {\n return (source) => {\n return observable((destination) => {\n let index = 0;\n const subscription = source.subscribe({\n next(value) {\n destination.next(project(value, index++));\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n return subscription;\n });\n };\n}\n\ninterface ShareConfig {}\n/**\n * Shares one subscription to the source between all subscribers. It\n * starts with the first subscriber and ends when the last unsubscribes.\n */\nexport function share<TValue, TError>(\n _opts?: ShareConfig,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n let refCount = 0;\n\n let subscription: Unsubscribable | null = null;\n // True while `source.subscribe` runs, so subscribers added by a synchronous\n // `next` join the starting source instead of starting another one\n let isConnecting = false;\n let observers = new Set<Partial<Observer<TValue, TError>>>();\n\n function startIfNeeded() {\n if (subscription || isConnecting) {\n return;\n }\n isConnecting = true;\n let isDone = false;\n let sourceSubscription: Unsubscribable;\n try {\n sourceSubscription = source.subscribe({\n next(value) {\n notify(observers, (observer) => observer.next?.(value));\n },\n error(error) {\n isDone = true;\n terminate((observer) => observer.error?.(error));\n },\n complete() {\n isDone = true;\n terminate((observer) => observer.complete?.());\n },\n });\n } finally {\n isConnecting = false;\n }\n // A synchronous terminal event fires before `subscribe` returns, and its\n // callbacks may already have started a new source\n if (isDone) {\n sourceSubscription.unsubscribe();\n } else {\n subscription = sourceSubscription;\n }\n }\n function notify(\n targets: Set<Partial<Observer<TValue, TError>>>,\n callback: (observer: Partial<Observer<TValue, TError>>) => void,\n ) {\n for (const observer of [...targets]) {\n if (targets.has(observer)) {\n callback(observer);\n }\n }\n }\n function terminate(\n callback: (observer: Partial<Observer<TValue, TError>>) => void,\n ) {\n // Cleared before notifying so a subscriber added during the callback\n // starts a fresh source whose events reach only the observers that\n // joined it; the old source is torn down only after every observer has\n // been notified, mirroring subscription order.\n const _sub = subscription;\n const terminatedObservers = observers;\n subscription = null;\n observers = new Set();\n isConnecting = false;\n try {\n notify(terminatedObservers, callback);\n } finally {\n _sub?.unsubscribe();\n }\n }\n function resetSource() {\n const _sub = subscription;\n subscription = null;\n _sub?.unsubscribe();\n }\n function resetIfNeeded() {\n // \"resetOnRefCountZero\"\n if (refCount === 0 && subscription) {\n resetSource();\n }\n }\n\n return observable((subscriber) => {\n refCount++;\n\n const subscriberObservers = observers;\n subscriberObservers.add(subscriber);\n startIfNeeded();\n return {\n unsubscribe() {\n refCount--;\n resetIfNeeded();\n\n subscriberObservers.delete(subscriber);\n },\n };\n });\n };\n}\n\n/** Calls `observer` with each value, error and completion, and passes them on unchanged. */\nexport function tap<TValue, TError>(\n observer: Partial<Observer<TValue, TError>>,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n return source.subscribe({\n next(value) {\n observer.next?.(value);\n destination.next(value);\n },\n error(error) {\n observer.error?.(error);\n destination.error(error);\n },\n complete() {\n observer.complete?.();\n destination.complete();\n },\n });\n });\n };\n}\n\nconst distinctUnsetMarker = Symbol();\n/** Skips values equal to the one before, by `compare` (`===` by default). */\nexport function distinctUntilChanged<TValue, TError>(\n compare: (a: TValue, b: TValue) => boolean = (a, b) => a === b,\n): MonoTypeOperatorFunction<TValue, TError> {\n return (source) => {\n return observable((destination) => {\n let lastValue: TValue | typeof distinctUnsetMarker = distinctUnsetMarker;\n\n return source.subscribe({\n next(value) {\n if (lastValue !== distinctUnsetMarker && compare(lastValue, value)) {\n return;\n }\n lastValue = value;\n destination.next(value);\n },\n error(error) {\n destination.error(error);\n },\n complete() {\n destination.complete();\n },\n });\n });\n };\n}\n\nconst isDeepEqual = <T>(a: T, b: T): boolean => {\n if (a === b) {\n return true;\n }\n const bothAreObjects =\n a && b && typeof a === 'object' && typeof b === 'object';\n\n return (\n !!bothAreObjects &&\n Object.keys(a).length === Object.keys(b).length &&\n Object.entries(a).every(([k, v]) => isDeepEqual(v, b[k as keyof T]))\n );\n};\n/**\n * Skips values equal to the one before, comparing objects and arrays by\n * their own enumerable keys. Objects without such keys, like two `Date`s,\n * always count as equal.\n */\nexport function distinctUntilDeepChanged<\n TValue,\n TError,\n>(): MonoTypeOperatorFunction<TValue, TError> {\n return distinctUntilChanged(isDeepEqual);\n}\n","import { observable } from './observable';\nimport type { Observable, Observer } from './types';\n\n/** An observable that holds a current value. */\nexport interface BehaviorSubject<TValue> extends Observable<TValue, never> {\n observable: Observable<TValue, never>;\n /** Sets the value and sends it to subscribers, if it changed. */\n next: (value: TValue) => void;\n /** The current value. */\n get: () => TValue;\n}\n\n/** A `BehaviorSubject` that can't be set. */\nexport interface ReadonlyBehaviorSubject<TValue> extends Omit<\n BehaviorSubject<TValue>,\n 'next'\n> {}\n\n/**\n * Creates an observable that holds a current value. New subscribers get\n * it right away, unless it's `undefined`.\n * @internal\n */\nexport function behaviorSubject<TValue>(\n initialValue: TValue,\n): BehaviorSubject<TValue> {\n let value: TValue = initialValue;\n\n const observerList = new Set<Observer<TValue, never>>();\n\n const addObserver = (observer: Observer<TValue, never>) => {\n if (value !== undefined) {\n observer.next(value);\n }\n observerList.add(observer);\n };\n const removeObserver = (observer: Observer<TValue, never>) => {\n observerList.delete(observer);\n };\n\n const obs = observable<TValue, never>((observer) => {\n addObserver(observer);\n return () => {\n removeObserver(observer);\n };\n }) as BehaviorSubject<TValue>;\n\n obs.next = (nextValue: TValue) => {\n if (value === nextValue) {\n return;\n }\n value = nextValue;\n // an observer can be removed while this loop is notifying it, and an\n // observer removed by an earlier callback must not be notified\n for (const observer of [...observerList]) {\n if (observerList.has(observer)) {\n observer.next(nextValue);\n }\n }\n };\n\n obs.get = () => value;\n\n return obs;\n}\n"],"mappings":";;;AASA,SAAgB,IACd,SAC6D;CAC7D,QAAQ,WAAW;EACjB,OAAO,YAAY,gBAAgB;GACjC,IAAI,QAAQ;GAYZ,OAXqB,OAAO,UAAU;IACpC,KAAK,OAAO;KACV,YAAY,KAAK,QAAQ,OAAO,OAAO,CAAC;IAC1C;IACA,MAAM,OAAO;KACX,YAAY,MAAM,KAAK;IACzB;IACA,WAAW;KACT,YAAY,SAAS;IACvB;GACF,CACkB;EACpB,CAAC;CACH;AACF;;;;;AAOA,SAAgB,MACd,OAC0C;CAC1C,QAAQ,WAAW;EACjB,IAAI,WAAW;EAEf,IAAI,eAAsC;EAG1C,IAAI,eAAe;EACnB,IAAI,4BAAY,IAAI,IAAuC;EAE3D,SAAS,gBAAgB;GACvB,IAAI,gBAAgB,cAClB;GAEF,eAAe;GACf,IAAI,SAAS;GACb,IAAI;GACJ,IAAI;IACF,qBAAqB,OAAO,UAAU;KACpC,KAAK,OAAO;MACV,OAAO,YAAY,aAAa;;OAAS,QAAA,iBAAA,SAAA,UAAA,QAAA,mBAAA,KAAA,IAAA,KAAA,IAAA,eAAA,KAAA,UAAO,KAAK;MAAC,CAAA;KACxD;KACA,MAAM,OAAO;MACX,SA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AAK,KAAK;EAErB,aAAa,IAAI,QAAQ;CAC3B;CACA,MAAM,kBAAkB,aAAsC;EAC5D,aAAa,OAAO,QAAQ;CAC9B;CAEA,MAAM,MAAM,YAA2B,aAAa;EAClD,YAAY,QAAQ;EACpB,aAAa;GACX,eAAe,QAAQ;EACzB;CACF,CAAC;CAED,IAAI,QAAQ,cAAsB;EAChC,IAAI,UAAU,WACZ;EAEF,QAAQ;EAGR,KAAK,MAAM,YAAY,CAAC,GAAG,YAAY,GACrC,IAAI,aAAa,IAAI,QAAQ,GAC3B,SAAS,KAAK,SAAS;CAG7B;CAEA,IAAI,YAAY;CAEhB,OAAO;AACT"}
|
|
@@ -103,66 +103,80 @@ function observableToPromise(observable) {
|
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
|
+
* Turns an observable into an async iterable, like Node's `events.on()`.
|
|
107
|
+
* Values wait in a queue until `next()` reads them. An error rejects the
|
|
108
|
+
* `next()` after the queued values, once. Completion, `return()` and aborting
|
|
109
|
+
* `signal` unsubscribe and end every pending `next()` with `{ done: true }`;
|
|
110
|
+
* anything the observable sends after that is ignored.
|
|
106
111
|
* @internal
|
|
107
112
|
*/
|
|
108
|
-
function
|
|
109
|
-
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
error(error) {
|
|
125
|
-
controller.enqueue({
|
|
126
|
-
ok: false,
|
|
127
|
-
error
|
|
128
|
-
});
|
|
129
|
-
controller.close();
|
|
130
|
-
},
|
|
131
|
-
complete() {
|
|
132
|
-
controller.close();
|
|
133
|
-
}
|
|
113
|
+
function observableToAsyncIterable(observable, signal) {
|
|
114
|
+
const values = [];
|
|
115
|
+
const pending = [];
|
|
116
|
+
let error = null;
|
|
117
|
+
let finished = false;
|
|
118
|
+
let subscription = null;
|
|
119
|
+
function finish() {
|
|
120
|
+
if (finished) return;
|
|
121
|
+
finished = true;
|
|
122
|
+
signal.removeEventListener("abort", finish);
|
|
123
|
+
try {
|
|
124
|
+
subscription === null || subscription === void 0 || subscription.unsubscribe();
|
|
125
|
+
} finally {
|
|
126
|
+
for (const promise of pending.splice(0)) promise.resolve({
|
|
127
|
+
value: void 0,
|
|
128
|
+
done: true
|
|
134
129
|
});
|
|
135
|
-
if (signal.aborted) onAbort();
|
|
136
|
-
else signal.addEventListener("abort", onAbort, { once: true });
|
|
137
|
-
},
|
|
138
|
-
cancel() {
|
|
139
|
-
onAbort();
|
|
140
130
|
}
|
|
131
|
+
}
|
|
132
|
+
subscription = observable.subscribe({
|
|
133
|
+
next(value) {
|
|
134
|
+
if (finished) return;
|
|
135
|
+
const promise = pending.shift();
|
|
136
|
+
if (promise) promise.resolve({
|
|
137
|
+
value,
|
|
138
|
+
done: false
|
|
139
|
+
});
|
|
140
|
+
else values.push(value);
|
|
141
|
+
},
|
|
142
|
+
error(cause) {
|
|
143
|
+
if (finished) return;
|
|
144
|
+
const promise = pending.shift();
|
|
145
|
+
if (promise) promise.reject(cause);
|
|
146
|
+
else error = { cause };
|
|
147
|
+
finish();
|
|
148
|
+
},
|
|
149
|
+
complete: finish
|
|
141
150
|
});
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
* unsubscribes from the observable but doesn't end a pending `next()`.
|
|
146
|
-
* @internal
|
|
147
|
-
*/
|
|
148
|
-
function observableToAsyncIterable(observable, signal) {
|
|
149
|
-
const reader = observableToReadableStream(observable, signal).getReader();
|
|
151
|
+
if (finished) subscription.unsubscribe();
|
|
152
|
+
else if (signal.aborted) finish();
|
|
153
|
+
else signal.addEventListener("abort", finish, { once: true });
|
|
150
154
|
const iterator = {
|
|
151
155
|
async next() {
|
|
152
|
-
|
|
153
|
-
|
|
156
|
+
if (values.length > 0) return {
|
|
157
|
+
value: values.shift(),
|
|
158
|
+
done: false
|
|
159
|
+
};
|
|
160
|
+
if (error) {
|
|
161
|
+
const { cause } = error;
|
|
162
|
+
error = null;
|
|
163
|
+
throw cause;
|
|
164
|
+
}
|
|
165
|
+
if (finished) return {
|
|
154
166
|
value: void 0,
|
|
155
167
|
done: true
|
|
156
168
|
};
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
};
|
|
169
|
+
return new Promise((resolve, reject) => {
|
|
170
|
+
pending.push({
|
|
171
|
+
resolve,
|
|
172
|
+
reject
|
|
173
|
+
});
|
|
174
|
+
});
|
|
163
175
|
},
|
|
164
176
|
async return() {
|
|
165
|
-
|
|
177
|
+
values.length = 0;
|
|
178
|
+
error = null;
|
|
179
|
+
finish();
|
|
166
180
|
return {
|
|
167
181
|
value: void 0,
|
|
168
182
|
done: true
|
|
@@ -177,4 +191,4 @@ function observableToAsyncIterable(observable, signal) {
|
|
|
177
191
|
export { observableToPromise as i, observable as n, observableToAsyncIterable as r, isObservable as t };
|
|
178
192
|
|
|
179
193
|
|
|
180
|
-
//# sourceMappingURL=observable-
|
|
194
|
+
//# sourceMappingURL=observable-DvsUkNRH.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observable-DvsUkNRH.mjs","names":[],"sources":["../src/observable/observable.ts"],"sourcesContent":["import type {\n Observable,\n Observer,\n OperatorFunction,\n TeardownLogic,\n UnaryFunction,\n Unsubscribable,\n} from './types';\n\n/**\n * The type of the values an observable emits.\n * @public\n */\nexport type inferObservableValue<TObservable> =\n TObservable extends Observable<infer TValue, unknown> ? TValue : never;\n\n/**\n * Whether a value is an observable: an object with `subscribe`.\n * @public\n */\nexport function isObservable(x: unknown): x is Observable<unknown, unknown> {\n return typeof x === 'object' && x !== null && 'subscribe' in x;\n}\n\n/**\n * Creates an observable. `subscribe` runs for each subscriber, and can\n * return a function that cleans up when it unsubscribes.\n * @example\n * ```ts\n * const ticks = observable<number>((observer) => {\n * const timer = setInterval(() => observer.next(Date.now()), 1000);\n * return () => clearInterval(timer);\n * });\n * ```\n * @see https://trpc.io/docs/client/links#creating-a-custom-link\n * @public\n */\nexport function observable<TValue, TError = unknown>(\n subscribe: (observer: Observer<TValue, TError>) => TeardownLogic,\n): Observable<TValue, TError> {\n const self: Observable<TValue, TError> = {\n subscribe(observer) {\n let teardownRef: TeardownLogic | null = null;\n let isDone = false;\n let unsubscribed = false;\n let teardownImmediately = false;\n function unsubscribe() {\n if (teardownRef === null) {\n teardownImmediately = true;\n return;\n }\n if (unsubscribed) {\n return;\n }\n unsubscribed = true;\n\n if (typeof teardownRef === 'function') {\n teardownRef();\n } else if (teardownRef) {\n teardownRef.unsubscribe();\n }\n }\n teardownRef = subscribe({\n next(value) {\n if (isDone) {\n return;\n }\n observer.next?.(value);\n },\n error(err) {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.error?.(err);\n unsubscribe();\n },\n complete() {\n if (isDone) {\n return;\n }\n isDone = true;\n observer.complete?.();\n unsubscribe();\n },\n });\n if (teardownImmediately) {\n unsubscribe();\n }\n return {\n unsubscribe,\n };\n },\n pipe(\n ...operations: OperatorFunction<any, any, any, any>[]\n ): Observable<any, any> {\n return operations.reduce(pipeReducer, self);\n },\n };\n return self;\n}\n\nfunction pipeReducer(prev: any, fn: UnaryFunction<any, any>) {\n return fn(prev);\n}\n\n/**\n * Resolves with an observable's first value. Rejects if it errors or\n * completes first. It doesn't unsubscribe after the first value.\n * @internal\n */\nexport function observableToPromise<TValue>(\n observable: Observable<TValue, unknown>,\n) {\n const ac = new AbortController();\n const promise = new Promise<TValue>((resolve, reject) => {\n let isDone = false;\n function onDone() {\n if (isDone) {\n return;\n }\n isDone = true;\n obs$.unsubscribe();\n }\n ac.signal.addEventListener('abort', () => {\n reject(ac.signal.reason);\n });\n const obs$ = observable.subscribe({\n next(data) {\n isDone = true;\n resolve(data);\n onDone();\n },\n error(data) {\n reject(data);\n },\n complete() {\n ac.abort();\n onDone();\n },\n });\n });\n return promise;\n}\n\n/**\n * Turns an observable into an async iterable, like Node's `events.on()`.\n * Values wait in a queue until `next()` reads them. An error rejects the\n * `next()` after the queued values, once. Completion, `return()` and aborting\n * `signal` unsubscribe and end every pending `next()` with `{ done: true }`;\n * anything the observable sends after that is ignored.\n * @internal\n */\nexport function observableToAsyncIterable<TValue>(\n observable: Observable<TValue, unknown>,\n signal: AbortSignal,\n): AsyncIterable<TValue> {\n const values: TValue[] = [];\n const pending: {\n resolve: (result: IteratorResult<TValue>) => void;\n reject: (cause: unknown) => void;\n }[] = [];\n let error: { cause: unknown } | null = null;\n let finished = false;\n let subscription: Unsubscribable | null = null;\n\n function finish() {\n if (finished) {\n return;\n }\n finished = true;\n signal.removeEventListener('abort', finish);\n try {\n subscription?.unsubscribe();\n } finally {\n for (const promise of pending.splice(0)) {\n promise.resolve({ value: undefined, done: true });\n }\n }\n }\n\n subscription = observable.subscribe({\n next(value) {\n if (finished) {\n return;\n }\n const promise = pending.shift();\n if (promise) {\n promise.resolve({ value, done: false });\n } else {\n values.push(value);\n }\n },\n error(cause) {\n if (finished) {\n return;\n }\n const promise = pending.shift();\n if (promise) {\n promise.reject(cause);\n } else {\n error = { cause };\n }\n finish();\n },\n complete: finish,\n });\n if (finished) {\n subscription.unsubscribe();\n } else if (signal.aborted) {\n finish();\n } else {\n signal.addEventListener('abort', finish, { once: true });\n }\n\n const iterator: AsyncIterator<TValue> = {\n async next() {\n if (values.length > 0) {\n return { value: values.shift() as TValue, done: false };\n }\n if (error) {\n const { cause } = error;\n error = null;\n throw cause;\n }\n if (finished) {\n return { value: undefined, done: true };\n }\n return new Promise((resolve, reject) => {\n pending.push({ resolve, reject });\n });\n },\n async return() {\n values.length = 0;\n error = null;\n finish();\n return { value: undefined, done: true };\n },\n };\n return {\n [Symbol.asyncIterator]() {\n return iterator;\n },\n };\n}\n"],"mappings":";;;;;AAoBA,SAAgB,aAAa,GAA+C;CAC1E,OAAO,OAAO,MAAM,YAAY,MAAM,QAAQ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;IAClB,QAAQ;IACR,MAAM;GACR;GACA,IAAI,UACF,OAAO;IAAE,OAAO,KAAA;IAAW,MAAM;GAAK;GAExC,OAAO,IAAI,SAAS,SAAS,WAAW;IACtC,QAAQ,KAAK;KAAE;KAAS;IAAO,CAAC;GAClC,CAAC;EACH;EACA,MAAM,SAAS;GACb,OAAO,SAAS;GAChB,QAAQ;GACR,OAAO;GACP,OAAO;IAAE,OAAO,KAAA;IAAW,MAAM;GAAK;EACxC;CACF;CACA,OAAO,EACL,CAAC,OAAO,iBAAiB;EACvB,OAAO;CACT,EACF;AACF"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const require_codes = require("./codes-Be-DrYMh.cjs");
|
|
2
2
|
const require_getErrorShape = require("./getErrorShape-BAuHhNuh.cjs");
|
|
3
3
|
const require_asyncGeneratorDelegate = require("./asyncGeneratorDelegate-CMdmcplC.cjs");
|
|
4
|
-
const require_observable = require("./observable-
|
|
4
|
+
const require_observable = require("./observable-C-kLxTDb.cjs");
|
|
5
5
|
//#region src/unstable-core-do-not-import/http/parseConnectionParams.ts
|
|
6
6
|
/**
|
|
7
7
|
* Checks that connection params are an object of strings, or `null`.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as identity, d as isObject$1, i as abortSignalsAnyPonyfill, l as isAsyncIterable, m as run, o as assertNever, s as emptyObject, u as isFunction } from "./codes-nbrm_zWY.mjs";
|
|
2
2
|
import { d as getHTTPStatusCode, n as _objectSpread2, r as _defineProperty, t as getErrorShape } from "./getErrorShape-B5jPKHJ3.mjs";
|
|
3
3
|
import { C as getTRPCErrorFromUnknown, a as _asyncIterator, b as transformTRPCResponse, m as getProcedureAtPath, n as isTrackedEnvelope, o as _wrapAsyncGenerator, s as _OverloadYield, t as _asyncGeneratorDelegate, u as urlPathToProcedurePath, x as TRPCError } from "./asyncGeneratorDelegate-JWx0LJUD.mjs";
|
|
4
|
-
import { r as observableToAsyncIterable, t as isObservable } from "./observable-
|
|
4
|
+
import { r as observableToAsyncIterable, t as isObservable } from "./observable-DvsUkNRH.mjs";
|
|
5
5
|
//#region src/unstable-core-do-not-import/http/parseConnectionParams.ts
|
|
6
6
|
/**
|
|
7
7
|
* Checks that connection params are an object of strings, or `null`.
|
|
@@ -2137,4 +2137,4 @@ async function resolveResponse(opts) {
|
|
|
2137
2137
|
export { getAcceptHeader as _, isPromise as a, parseConnectionParamsFromString as b, createDeferred as c, _usingCtx as d, makeAsyncResource as f, throwAbortError as g, isAbortError as h, sseStreamProducer as i, iteratorResource as l, Unpromise as m, sseHeaders as n, jsonlStreamConsumer as o, makeResource as p, sseStreamConsumer as r, jsonlStreamProducer as s, resolveResponse as t, takeWithGrace as u, getLastEventId as v, parseConnectionParamsFromUnknown as x, getRequestInfo as y };
|
|
2138
2138
|
|
|
2139
2139
|
|
|
2140
|
-
//# sourceMappingURL=resolveResponse-
|
|
2140
|
+
//# sourceMappingURL=resolveResponse-F8DsMtod.mjs.map
|