OreQr
OreQr
Explore posts from servers
TTCTheo's Typesafe Cult
Created by Court on 1/14/2025 in #questions
NextAuth.js is now part of the Auth.js
Hi @Court, what errors? T3 uses next-auth5.0.0-beta.x which is already https://authjs.dev/ you need to look at this documentation
4 replies
TTCTheo's Typesafe Cult
Created by NinjaBunny on 1/15/2025 in #questions
real time video stream that gets served to multiple users
Hi @NinjaBunny, why don't you just use hls streaming? You could skip whole rabbit mq, pipeline stuff. And when you need to use it you can just send video/mp4 instead of text/event-stream
10 replies
TTCTheo's Typesafe Cult
Created by şiar_619 on 1/15/2025 in #questions
Admin authentication
@şiar_619 If you want to do this TimTim way on server side layout, remember to add additional check on every children page or you gonna leak data.
4 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
bump
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
bump
74 replies
TtRPC
Created by 7up on 9/12/2024 in #❓-help
NextJS App Routers with tRPC: can't call query on server component
3 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
bump
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
I got it to this point but input and output data is any
/* eslint-disable @typescript-eslint/no-explicit-any */
import { type TRPCClientErrorLike } from "@trpc/client"
import {
type DecorateProcedure,
type UseTRPCQueryResult,
} from "@trpc/react-query/shared"
import {
type AnyTRPCQueryProcedure,
type inferProcedureInput,
} from "@trpc/server"

type ExtendedProcedure<T extends AnyTRPCQueryProcedure> = {
_def: {
$values: {
input: T["_def"]["$types"]["input"]
output: T["_def"]["$types"]["output"]
transformer: any
errorShape: any
}
}
} & T

export function useLazySuspenseQuery<
T extends ExtendedProcedure<AnyTRPCQueryProcedure>,
TDef extends T["_def"]["$values"],
>(
path: DecorateProcedure<"query", T["_def"]["$values"]>,
input: inferProcedureInput<T>
): UseTRPCQueryResult<TDef["output"], TRPCClientErrorLike<TDef>> {
return path.useQuery(input)
}
/* eslint-disable @typescript-eslint/no-explicit-any */
import { type TRPCClientErrorLike } from "@trpc/client"
import {
type DecorateProcedure,
type UseTRPCQueryResult,
} from "@trpc/react-query/shared"
import {
type AnyTRPCQueryProcedure,
type inferProcedureInput,
} from "@trpc/server"

type ExtendedProcedure<T extends AnyTRPCQueryProcedure> = {
_def: {
$values: {
input: T["_def"]["$types"]["input"]
output: T["_def"]["$types"]["output"]
transformer: any
errorShape: any
}
}
} & T

export function useLazySuspenseQuery<
T extends ExtendedProcedure<AnyTRPCQueryProcedure>,
TDef extends T["_def"]["$values"],
>(
path: DecorateProcedure<"query", T["_def"]["$values"]>,
input: inferProcedureInput<T>
): UseTRPCQueryResult<TDef["output"], TRPCClientErrorLike<TDef>> {
return path.useQuery(input)
}
Versions: - Typescript: 5.5.3 - tRPC: 11.0.0-rc.477
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
How to make it work with tRPC v11?
74 replies
TtRPC
Created by thomasplayschess on 9/13/2023 in #❓-help
Wrapping useQuery into a custom hook
+1
74 replies
CDCloudflare Developers
Created by OreQr on 4/9/2024 in #pages-help
Deployment fails
unfortunately not now because I moved to self hosted
10 replies
CDCloudflare Developers
Created by OreQr on 4/9/2024 in #pages-help
Deployment fails
Yes, drizzle work great on edge and it is more performent
10 replies