Effect CommunityEC
Effect Community3mo ago
7 replies
ooga

Preventing `AtomHttpApi.mutation` from Closing HTTP Connection on New Requests

How to prevent AtomHttpApi.mutation to close http connection to the server when a new request is triggered before the previous has been done ?

I'm working on an autocomplete field and using this piece of code
const searchBusinessUnits = useAtomSet(
  AtomApiClient.mutation("business", "autocomplete"),
  { mode: "promiseExit" },
);


Whe I call searchBusinessUnits too quickly, the old http resquest is interrupted and I the server ended with this error All fibers interrupted without errors.
To avoid this errors on the server, I would like to keep the request alive and just ignore the result.
Was this page helpful?