You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
constactiveReqs=newMap<string,BatchedItem[]>();// TODO: Deduplicate fetches by queryKey hash// TODO: --- CLEANUP BELOWexporttypeMapKey=["path"|"id",string];exportconsttoMapId=(op: Operation|RspcResponse)=>// @ts-expect-error // TODO: Fix this("id"inop ? ["id",op.id] : ["path",op.path])satisfiesMapKey;// export const toMapId = (op: Operation | RspcResponse) =>// "id" in op// ? ["id", op.id].join(",")// : ["path", op.path, JSON.stringify("TODO: ARG")].join(",");// Copied from: https://github.com/jonschlinkert/is-plain-objectexportfunctionisPlainObject(o: any): o is Object{if(!hasObjectPrototype(o)){returnfalse;}// If has modified constructorconstctor=o.constructor;if(typeofctor==="undefined"){returntrue;}// If has modified prototypeconstprot=ctor.prototype;if(!hasObjectPrototype(prot)){returnfalse;}// If constructor does not have an Object-specific methodif(!prot.hasOwnProperty("isPrototypeOf")){returnfalse;}// Most likely a plain Objectreturntrue;}functionhasObjectPrototype(o: any): boolean{returnObject.prototype.toString.call(o)==="[object Object]";}// This is copied from the React Query `hashQueryKey` function.exportfunctionhashOperation(queryKey: Operation): string{returnJSON.stringify(queryKey,(_,val)=>isPlainObject(val)
? Object.keys(val).sort().reduce((result,key)=>{result[key]=val[key];returnresult;},{}asany)
: val);}exportconstgenerateRandomId=()=>Math.random().toString(36).slice(2);// TODO: Remove and use incremental counterfunctionhashedQueryKey(){// TSH = (s) => {// for (var i = 0, h = 9; i < s.length; )// h = Math.imul(h ^ s.charCodeAt(i++), 9 ** 9);// return h ^ (h >>> 9);// };}
When using the Solid or React integration this is deal with by them.
Do deduplication of queries and mutations inside of the http and websocket links.
The text was updated successfully, but these errors were encountered: