MCPcopy Create free account
hub / github.com/effect-app/libs / projectQueryFor

Function projectQueryFor

packages/vue/src/makeClient.ts:809–838  ·  view source on GitHub ↗
(
    handler: RequestHandlerWithInput<I, A, E, RT, Request, Name>
  )

Source from the content-addressed store, hash-verified

807 family: useStreamQueryFamily(handler),
808 atom: useStreamQueryAtom(handler),
809 query: useStreamQuery(handler),
810 queryNew: useStreamQueryNew(handler)
811 })
812
813 const projectQueryFor = <
814 I,
815 A,
816 E,
817 Request extends Req & { readonly success: S.Top & { readonly "EncodingServices": RT } },
818 Name extends string
819 >(
820 handler: RequestHandlerWithInput<I, A, E, RT, Request, Name>
821 ) =>
822 <ProjSchema extends S.Top & { readonly "DecodingServices": RT }>(projectionSchema: ProjSchema) => {
823 const successSchema = handler.Request.success
824 const projectionHash = projectionSchemaHash(projectionSchema)
825 const projected = projectHandler(handler.handler, successSchema, projectionSchema)
826 const projectedHandler = {
827 handler: projected,
828 id: handler.id,
829 Request: handler.Request,
830 queryKeyProjectionHash: projectionHash
831 }
832 if (handler.options) {
833 return {
834 request: projected,
835 ...queryHelpersFor({ ...projectedHandler, options: handler.options })
836 }
837 }
838 return {
839 request: projected,
840 ...queryHelpersFor(projectedHandler)
841 }

Callers 1

mapClientFunction · 0.85

Calls 3

projectionSchemaHashFunction · 0.85
projectHandlerFunction · 0.85
queryHelpersForFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…