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/plugins/chat/assets/javascripts/discourse/components/reviewable-chat-message.js
David Taylor 2b53c2cfca
DEV: Enable @cached decorator for themes and plugins (#19261)
`ember-cached-decorator-polyfill` uses a Babel transformation to apply this polyfill in core. Adding that Babel transformation to themes and plugins will be complex, so we use this to patch it at runtime. This can be removed once `@glimmer/tracking` is updated to a version
with native `@cached` support.
2022-11-30 15:53:54 +00:00

16 lines
366 B
JavaScript

import Component from "@glimmer/component";
import { inject as service } from "@ember/service";
import { cached } from "@glimmer/tracking";
export default class ReviewableChatMessage extends Component {
@service store;
@cached
get chatChannel() {
return this.store.createRecord(
"chat-channel",
this.args.reviewable.chat_channel
);
}
}