Fix lint nits

This commit is contained in:
Andreas Nedbal 2021-12-25 04:05:03 +01:00
parent d27665471e
commit 8b583e103a
2 changed files with 5 additions and 3 deletions

View File

@ -6,7 +6,7 @@ export function userActionHandler(event: Event): void {
const target = button.dataset.target;
const action = button.dataset.action;
let targetURL = action === 'follow' ? '/ajax/create_friend' : '/ajax/destroy_friend';
const targetURL = action === 'follow' ? '/ajax/create_friend' : '/ajax/destroy_friend';
let success = false;
Rails.ajax({

View File

@ -1,7 +1,9 @@
export function on(type: string, selector: string, callback: Function): void {
type OnCallbackFunction = (event: Event) => void;
export function on(type: string, selector: string, callback: OnCallbackFunction): void {
document.addEventListener(type, (event: Event) => {
if ((event.target as HTMLElement).matches(selector)) {
callback(event);
}
});
};
}