This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/assets/javascripts/discourse/tests/unit
David Taylor e08a0b509d
DEV: Support @debounce decorator in native class syntax (#20521)
The implementation previously generated a descriptor with an `initializer()`, and bound the function to the `this` context of the initializer. In native class syntax, the initializer of a descriptor is only called once, with a `this` context of the constructor, not the instance.

This commit updates the implementation so that it generates the bound function on-demand using a getter. This is the same strategy employed by ember's built-in `@action` decorator.

Unfortunately, this use of a getter means that the `@observes` decorator does not support being directly chained to `@debounce`. It throws the error "`observer must be provided a function or an observer definition`". The workaround is to put the observer on its own function, which then calls the debounced function. Given that we're aiming to reduce our usage of `@observes`, we've accepted the need for this workaround rather than spending the time to patch the implementation of `@observes`.
2023-03-03 11:48:58 +00:00
..
controllers DEV: Deprecate create-store test helper (#19021) 2022-11-16 10:54:46 +01:00
ember DEV: Support theme/plugin overrides of colocated component templates (#19237) 2022-11-30 14:14:38 +00:00
lib FIX: autocomplete failing for :( (#20461) 2023-02-28 11:35:19 +11:00
mixins DEV: Deprecate assert.not() (#15595) 2022-02-09 18:49:05 +01:00
models FIX: Don't set categoryId on PM drafts (#20475) 2023-03-01 11:32:12 +01:00
routes DEV: Add tests for review-index route (#18415) 2022-10-05 12:39:35 +08:00
services FIX: Don't spam presence requests when getting 429 (#20084) 2023-01-31 09:49:23 +01:00
utils DEV: Support @debounce decorator in native class syntax (#20521) 2023-03-03 11:48:58 +00:00
localization-test.js FIX: Overriding text with admin_js.* keys didn't work (#18281) 2022-09-20 10:47:57 +10:00