a tool for shared writing and social publishing

limit mutations pushed at once

+12 -2
+12 -2
src/replicache/index.tsx
··· 1 1 "use client"; 2 2 import { createContext, useContext, useEffect, useMemo, useState } from "react"; 3 3 import { useSubscribe } from "replicache-react"; 4 - import { DeepReadonlyObject, Replicache, WriteTransaction } from "replicache"; 4 + import { 5 + DeepReadonlyObject, 6 + PushRequest, 7 + PushRequestV1, 8 + Replicache, 9 + WriteTransaction, 10 + } from "replicache"; 5 11 import { Pull } from "./pull"; 6 12 import { mutations } from "./mutations"; 7 13 import { Attributes, Data } from "./attributes"; ··· 69 75 ) as ReplicacheMutators, 70 76 licenseKey: "l381074b8d5224dabaef869802421225a", 71 77 pusher: async (pushRequest) => { 78 + let smolpushRequest = { 79 + ...pushRequest, 80 + mutations: pushRequest.mutations.slice(0, 250), 81 + } as PushRequest; 72 82 return { 73 - response: await Push(pushRequest, props.name, props.token), 83 + response: await Push(smolpushRequest, props.name, props.token), 74 84 httpRequestInfo: { errorMessage: "", httpStatusCode: 200 }, 75 85 }; 76 86 },