Skip to content

Commit

Permalink
throttle doesn't work, falling back on debounce
Browse files Browse the repository at this point in the history
  • Loading branch information
Azeirah committed Jan 29, 2015
1 parent 65be77a commit c9faef2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions client/editor/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ var validateNote = function(note) {

var updatePreviewNote = function() {
var that = this;
return _.throttle(function(event, t) {
return _.debounce(function(event, t) {
t = t || that;
var note = createNoteObject(t);
["title", "tags", "content"].forEach(function (key) {
Expand All @@ -43,7 +43,7 @@ var updatePreviewNote = function() {
// This is a bit of a hack, Session.get("previewNoteUpdated") will only update when the value changes
// what I really wanted to do here is send a signal, I don't want to preserve data, so I'm actually abusing the Session.
Session.set( "previewNoteUpdated", Math.random() );
}, 70);
}, 300);
};

var inputValidationFeedback = function(t) {
Expand Down

0 comments on commit c9faef2

Please sign in to comment.