/**
* The main router for the backend, contains all other routers
*/
const appRouter = t.router({
invalidator: publicProcedure.subscription(() => {
return observable<TRPCQueryKey>((emit) => {
ee.on("invalidate", (key) => {
emit.next(key);
});
return () => {
ee.off("invalidate");
};
});
}),
});
export type AppRouter = typeof appRouter;
const rtrpc = createTRPCReact<AppRouter>();
const qk = getQueryKey(rtrpc.thing.getThing, "1"); // use this along with an eventemitter to invalidate queries on the client
/**
* The main router for the backend, contains all other routers
*/
const appRouter = t.router({
invalidator: publicProcedure.subscription(() => {
return observable<TRPCQueryKey>((emit) => {
ee.on("invalidate", (key) => {
emit.next(key);
});
return () => {
ee.off("invalidate");
};
});
}),
});
export type AppRouter = typeof appRouter;
const rtrpc = createTRPCReact<AppRouter>();
const qk = getQueryKey(rtrpc.thing.getThing, "1"); // use this along with an eventemitter to invalidate queries on the client