Is your feature request related to a problem? Please describe.
It would be really helpful if the remote persister allowed throttling or debouncing the rate at which it saves.
Describe the solution you'd like
It could either be an argument to createRemotePersister the same way autoLoadIntervalSeconds works, or for people who want more control it could be a function of the save function, so that people could do something like:
Describe alternatives you've considered
If my remote persister is a node server then I can just throttle/debounce database writes on the server side, but ideally it would be great if this could work with serverless functions which don't run continuously. In that case I can only see it working if it's throttled on the client-side.
Additional context
Thank you for this awesome library!
Good idea! In the meantime, you could defend against craziness by wrapping multiple fast changes in a transaction. (The autoSave only updates at the end of a transaction)
Is your feature request related to a problem? Please describe. It would be really helpful if the remote persister allowed throttling or debouncing the rate at which it saves.
Describe the solution you'd like It could either be an argument to
createRemotePersister
the same wayautoLoadIntervalSeconds
works, or for people who want more control it could be a function of thesave
function, so that people could do something like:Describe alternatives you've considered If my remote persister is a node server then I can just throttle/debounce database writes on the server side, but ideally it would be great if this could work with serverless functions which don't run continuously. In that case I can only see it working if it's throttled on the client-side.
Additional context Thank you for this awesome library!