Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Debounce instead of throttle (#55)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cyclodex authored and mpetrovich committed Dec 16, 2018
1 parent 25cb268 commit eec7c61
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/stylemark
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ var delay = (watch === true) ? 2000 : watch;
var browser = args.b;
var port = _.isNumber(browser) ? browser : null;

var generate = _.throttle(
var generate = _.debounce(
function() {
console.log('Generating style guide...');
stylemark({
Expand All @@ -26,7 +26,8 @@ var generate = _.throttle(
configPath: configPath,
});
},
delay
delay,
{ leading: false, trailing: true }
);

generate();
Expand Down

0 comments on commit eec7c61

Please sign in to comment.