MCPcopy Index your code
hub / github.com/material-shell/material-shell / observe

Method observe

src/manager/msManager.ts:20–39  ·  view source on GitHub ↗
(
        subject: WithSignals | GObject.Object,
        property: string,
        // eslint-disable-next-line @typescript-eslint/no-explicit-any
        callback: (...args: any[]) => void
    )

Source from the content-addressed store, hash-verified

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) {

Callers 9

constructorMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
constructorMethod · 0.45
setupNewWorkspaceMethod · 0.45
constructorMethod · 0.45
addMethod · 0.45

Calls 4

connectMethod · 0.65
pushMethod · 0.65
spliceMethod · 0.65
disconnectMethod · 0.65

Tested by

no test coverage detected