Fix lint nits
This commit is contained in:
parent
d27665471e
commit
8b583e103a
|
@ -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({
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
});
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue