discourse/plugins
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
..
chat UX: update user chat preference link for new nav (#20518) 2023-03-03 06:50:47 +08:00
discourse-details DEV: Apply syntax_tree formatting to `plugins/*` 2023-01-07 11:11:37 +00:00
discourse-local-dates DEV: Support `@debounce` decorator in native class syntax (#20521) 2023-03-03 11:48:58 +00:00
discourse-narrative-bot UX/DEV: Review queue redesign fixes (#20239) 2023-03-02 16:40:53 +01:00
discourse-presence Update translations (#20370) 2023-02-20 11:01:01 +01:00
lazy-yt FIX: lazy_yt_enabled doesn't affect the engine (#19997) 2023-01-25 12:40:57 -03:00
poll Update translations (#19974) 2023-01-24 16:32:34 +01:00
styleguide Update translations (#20389) 2023-02-21 17:12:10 +01:00