mirror of
https://github.com/atom/atom.git
synced 2026-01-27 07:47:58 -05:00
Avoid binding method before it’s spied upon when debouncing
This commit is contained in:
@@ -119,8 +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)
|
||||
debouncedSaveStateSync = _.debounce((=> @saveStateSync()), 1000)
|
||||
@document.addEventListener('mousedown', debouncedSaveStateSync, true)
|
||||
@document.addEventListener('keypress', debouncedSaveStateSync, true)
|
||||
|
||||
@state = {version: @constructor.version}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user