(
subject: WithSignals | GObject.Object,
property: string,
// eslint-disable-next-line @typescript-eslint/no-explicit-any
callback: (...args: any[]) => void
)
| 18 | } |
| 19 | |
| 20 | observe( |
| 21 | subject: WithSignals | GObject.Object, |
| 22 | property: string, |
| 23 | // eslint-disable-next-line @typescript-eslint/no-explicit-any |
| 24 | callback: (...args: any[]) => void |
| 25 | ) { |
| 26 | const signal = { |
| 27 | from: subject, |
| 28 | id: subject.connect(property, callback), |
| 29 | }; |
| 30 | this.signals.push(signal); |
| 31 | if (subject instanceof Clutter.Actor) { |
| 32 | subject.connect('destroy', () => { |
| 33 | this.signals.splice(this.signals.indexOf(signal), 1); |
| 34 | }); |
| 35 | } |
| 36 | return () => { |
| 37 | subject.disconnect(signal.id); |
| 38 | }; |
| 39 | } |
| 40 | destroy() { |
| 41 | this.signals.forEach((signal) => { |
| 42 | if (signal.from) { |
no test coverage detected