mirror of
https://github.com/Kong/insomnia
synced 2024-11-07 22:30:15 +00:00
15 lines
357 B
JavaScript
15 lines
357 B
JavaScript
import {LOCALSTORAGE_DEBOUNCE_MILLIS} from "../constants/global";
|
|
|
|
let timeout = null;
|
|
export default (store) => next => action => {
|
|
let result = next(action);
|
|
|
|
clearTimeout(timeout);
|
|
|
|
timeout = setTimeout(() => {
|
|
localStorage['insomnia'] = JSON.stringify(store.getState(), null, 2);
|
|
}, LOCALSTORAGE_DEBOUNCE_MILLIS);
|
|
|
|
return result;
|
|
};
|