Save state on mousedown or keypress events (debounce 1s). Tests WIP

This commit is contained in:
Katrina Uychaco
2016-01-27 11:15:02 -07:00
parent 39cb52c224
commit df83078d74
2 changed files with 16 additions and 0 deletions

View File

@@ -119,6 +119,9 @@ class AtomEnvironment extends Model
constructor: (params={}) ->
{@blobStore, @applicationDelegate, @window, @document, configDirPath, @enablePersistence, onlyLoadBaseStyleSheets} = params
@document.addEventListener('mousedown', _.debounce(@saveStateSync.bind(this), 1000), true)
@document.addEventListener('keypress', _.debounce(@saveStateSync.bind(this), 1000), true)
@state = {version: @constructor.version}
@loadTime = null