gnome-shell/tests/unit
Florian Müllner f45ccc9143 signalTracker: Provide monkey-patching for (dis)connectObject()
The module exports a `addObjectSignalMethods()` method that extends
the provided prototype with `connectObject()` and `disconnectObject()`
methods.

In its simplest form, `connectObject()` looks like the regular
`connect()` method, except for an additional parameter:

```js
    this._button.connectObject('clicked',
        () => this._onButtonClicked(), this);
```

The additional object can be used to disconnect all handlers on the
instance that were connected with that object, similar to
`g_signal_handlers_disconnect_by_data()` (which cannot be used
from introspection).

For objects that are subclasses of Clutter.Actor, that will happen
automatically when the actor is destroyed, similar to
`g_signal_connect_object()`.

Finally, `connectObject()` allows to conveniently connect multiple
signals at once, similar to `g_object_connect()`:

```js
    this._toggleButton.connect(
        'clicked', () => this._onClicked(),
        'notify::checked', () => this._onChecked(), this);
```

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1953>
2022-03-04 14:14:37 +00:00
..
highlighter.js tests: Add unit test for highlighter 2021-12-22 16:47:18 +00:00
insertSorted.js Util: fix binary search exit condition 2011-12-20 22:44:03 +01:00
jsParse.js style: Fix indentation errors 2019-07-02 12:17:46 +00:00
markup.js tests: Work around import dependency loop 2019-02-07 02:46:51 +01:00
params.js tests: Add Params.parse() unit tests 2019-07-05 18:28:26 +02:00
signalTracker.js signalTracker: Provide monkey-patching for (dis)connectObject() 2022-03-04 14:14:37 +00:00
url.js util: Handle trailing LTR/RTL markers in URLs 2019-09-16 20:41:47 +00:00
versionCompare.js util: Add a GNOME version comparison function 2021-02-05 13:41:26 +00:00