Create simple debounce and throttle instead of _.

This commit is contained in:
Hongarc 2018-12-05 12:08:41 +07:00
parent ae0030daa7
commit e6d7edd130
7 changed files with 43 additions and 8 deletions

View file

@ -2,6 +2,7 @@ var _ = require('underscore');
var Q = require('q');
var Views = require('../views');
var throttle = require('../util/throttle');
var ModalTerminal = Views.ModalTerminal;
var ContainedBase = Views.ContainedBase;
@ -97,7 +98,7 @@ var MarkdownGrabber = ContainedBase.extend({
keyup: function() {
if (!this.throttledPreview) {
this.throttledPreview = _.throttle(
this.throttledPreview = throttle(
this.updatePreview.bind(this),
500
);