Skip to content

Commit e0daadd

Browse files
Remove unused evented from ListContent (#2621)
1 parent f3b2de0 commit e0daadd

File tree

1 file changed

+0
-53
lines changed

1 file changed

+0
-53
lines changed

app/components/list-content.ts

-53
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
import { action } from '@ember/object';
2-
import { addListener, removeListener, sendEvent } from '@ember/object/events';
32
import { inject as service } from '@ember/service';
43
import Component from '@glimmer/component';
54
import { htmlSafe } from '@ember/template';
65
import { schedule } from '@ember/runloop';
76
import { tracked } from '@glimmer/tracking';
8-
import type { AnyFn } from 'ember/-private/type-utils';
97

108
import type LayoutService from '../services/layout';
119

@@ -96,55 +94,4 @@ export default class ListContent extends Component<ListContentSignature> {
9694
updateContentHeight(height: number) {
9795
this.contentHeight = height;
9896
}
99-
100-
// Manually implement Evented functionality, so we can move away from the mixin
101-
// TODO: Do we even need any evented-like things in this component?
102-
103-
on(eventName: string, method: AnyFn): void;
104-
on(eventName: string, target: unknown, method: AnyFn): void;
105-
106-
@action
107-
on(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn): void {
108-
if (typeof targetOrMethod === 'function') {
109-
// If we did not pass a target, default to `this`
110-
addListener(this, eventName, this, targetOrMethod as AnyFn);
111-
} else {
112-
addListener(this, eventName, targetOrMethod, method!);
113-
}
114-
}
115-
116-
one(eventName: string, method: AnyFn): void;
117-
one(eventName: string, target: unknown, method: AnyFn): void;
118-
119-
@action
120-
one(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn) {
121-
if (typeof targetOrMethod === 'function') {
122-
// If we did not pass a target, default to `this`
123-
addListener(this, eventName, this, targetOrMethod as AnyFn, true);
124-
} else {
125-
addListener(this, eventName, targetOrMethod, method!, true);
126-
}
127-
}
128-
129-
off(eventName: string, method: AnyFn): void;
130-
off(eventName: string, target: unknown, method: AnyFn): void;
131-
132-
@action
133-
off(eventName: string, targetOrMethod: unknown | AnyFn, method?: AnyFn) {
134-
try {
135-
if (typeof targetOrMethod === 'function') {
136-
// If we did not pass a target, default to `this`
137-
removeListener(this, eventName, this, targetOrMethod as AnyFn);
138-
} else {
139-
removeListener(this, eventName, targetOrMethod, method!);
140-
}
141-
} catch (e) {
142-
console.error(e);
143-
}
144-
}
145-
146-
@action
147-
trigger(eventName: string, ...args: Array<any>) {
148-
sendEvent(this, eventName, args);
149-
}
15097
}

0 commit comments

Comments
 (0)