2 * Copyright 2015-present Greg Hurrell. All rights reserved.
3 * Licensed under the terms of the MIT license.
11 * Debounce implementation that fires on the trailing edge only. If a call comes
12 * in when a pending call is yet to be finalized, it replaces the pending call.
14 export default function debounce(fn, interval) {
17 const args = arguments;
19 clearTimeout(timeout);
20 timeout = setTimeout(() => fn.apply(context, args), interval);