Review of "Coverflow Alt-Tab" version 56

Details Page Preview

Replacement of Alt-Tab, iterates through windows in a cover-flow manner.

Extension Homepage
https://github.com/dsheeler/CoverflowAltTab

No comments.

Diff Against

Files

Note: Binary files aren't shown on the web site. To see all files, please download the extension zipfile.

All Versions

Previous Reviews on this Version

JustPerfection rejected
You cannot create objects in global scope which is the same as init (line 110 prefs.js): https://gjs.guide/extensions/review-guidelines/review-guidelines.html#only-use-init-for-initialization
dsheeler posted a review
Would it be okay to declare and initialize that variable in a const global statement instead of in init?
JustPerfection posted a review
No, create it as local in `fillPreferencesWindow()` and send it as dependency injection to the functions they need it. The reason we are against global variables is that they won't get garbage collected after prefs window close. You can also attach it to the `window` to avoid garbage collecting before window close.
dsheeler posted a review
Gotcha about the globals and GC. Thanks for the explanation! And by 'send it as dependency injection to the functions they need it,' you mean pass as arguments, or something fancier?
JustPerfection posted a review
You can use that as argument for those functions or you can move those functions to a class and use dependency injection like this: ```js class Prefs { constructor(settings) { this._settings = settings; } doSomething() { // use `this._settings` here } fillWindow(window) { // to avoid garbage collecting before close this._window._prefsSettings = this._settings; // ... } } function fillPreferencesWindow(window) { // .. let settings = Lib.getSettings(SCHEMA); let prefs = new Prefs(settings); prefs.fillWindow(window); } ```