Skip to content

Commit

Permalink
Debounce saveState call
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigok committed Jan 19, 2017
1 parent b01e9ac commit e7ad823
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"electron-notification-shim": "^1.1.0",
"electron-toaster": "^2.0.2",
"spellchecker": "3.3.1",
"lodash": "^4.17.4",
"electron-rebuild": "1.5.6"
},
"devDependencies": {
Expand Down
3 changes: 2 additions & 1 deletion src/background/windowState.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import { app } from 'electron';
import jetpack from 'fs-jetpack';
import _ from 'lodash';

export default function (name, defaults) {

Expand Down Expand Up @@ -47,6 +48,6 @@ export default function (name, defaults) {
get isMaximized () { return state.isMaximized; },
get isMinimized () { return state.isMinimized; },
get isHidden () { return state.isHidden; },
saveState: saveState
saveState: _.debounce(saveState, 1000)
};
}

0 comments on commit e7ad823

Please sign in to comment.