feat: replace scroll-touch* with generic input-event (#35531)

This commit is contained in:
Jeremy Rose 2022-09-27 14:47:46 -05:00 committed by GitHub
parent dfb8a2d804
commit f82a863f65
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 253 additions and 138 deletions

View file

@ -3,10 +3,13 @@ type DeprecationHandler = (message: string) => void;
let deprecationHandler: DeprecationHandler | null = null;
export function warnOnce (oldName: string, newName?: string) {
let warned = false;
const msg = newName
return warnOnceMessage(newName
? `'${oldName}' is deprecated and will be removed. Please use '${newName}' instead.`
: `'${oldName}' is deprecated and will be removed.`;
: `'${oldName}' is deprecated and will be removed.`);
}
export function warnOnceMessage (msg: string) {
let warned = false;
return () => {
if (!warned && !process.noDeprecation) {
warned = true;