mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:57:10 -06:00
DEV: Deprecate the unused version of debounce (#29324)
This commit is contained in:
parent
b9ec9c7e4f
commit
e27e89fbfb
@ -1,10 +1,20 @@
|
||||
import { debounce } from "@ember/runloop";
|
||||
import deprecated from "discourse-common/lib/deprecated";
|
||||
|
||||
/**
|
||||
Debounce a Javascript function. This means if it's called many times in a time limit it
|
||||
should only be executed once (at the end of the limit counted from the last call made).
|
||||
Original function will be called with the context and arguments from the last call made.
|
||||
**/
|
||||
export default function (func, wait) {
|
||||
deprecated(
|
||||
"Importing from `discourse/lib/debounce` is deprecated. Import from `discourse-common/lib/debounce` instead.",
|
||||
{
|
||||
id: "discourse.discourse-debounce",
|
||||
since: "3.4.0.beta3-dev",
|
||||
}
|
||||
);
|
||||
|
||||
let args;
|
||||
const later = () => {
|
||||
func.apply(this, args);
|
||||
|
Loading…
Reference in New Issue
Block a user