(
handler: RequestHandlerWithInput<I, A, E, RT, Request, Name>
)
| 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 | } |
no test coverage detected
searching dependent graphs…