Closed dannybloe closed 8 years ago
But shouldn't redux-storage-decorator-debounce be the right solution for you?
import debounce from 'redux-storage-decorator-debounce'
engine = debounce(engine, 1000);
Should have the same effect as your experiment, as debounce
also uses setTimeout
!?
/me scratches his head... and tries again
😂
Doh.. we had a too-low debounce timeout value. Ignore this :)
Ehm... is it possible to do a write on onBeforeUnload if it happens before the debounce timeout?
You mean window.onBeforeUnload
? Please file a bug with this at redux-storage-decorator-debounce
We are currently using redux-storage and are experiencing that it slows down our app quite significantly due to many writes (debouncing didn't help in our case). As a small experiment we put a setTimeout(.., 1000) around the engine.save() command because we only want to save stuff as soon as there is no UI thread doing anything. And lo and behold, that surely sped things up quite a bit.
Would it be possible to have this as a feature and if not, are there complications?
Cheers,
Danny