I'm trying to work out the best way to get Redux Offline to debounce server requests.
Currently when the server is busy, it saves them up in a queue and sends all of them. I'd like it just to save the last one but use the same Save action to update the redux store.
My code in the action is:
export class SaveSession extends OfflineAction<SessionTypes> {
public readonly type = SessionTypes.SAVE_SESSION;
constructor(public session: ISession) {
super();
this.meta = {
offline: {
effect: {
url: `${process.env.REACT_APP_API}/api/session/save`,
body: JSON.stringify(session),
method: 'POST',
headers: authHeader()
},
commit: new SaveSessionSuccess(),
rollback: new SaveSessionError()
}
};
}
}
I'm looking through the documentation but I can't see anything around debouncing server requests.
Is this possible?