David Taylor 1df97e86c1
DEV: Introduce faker.js for use in tests & styleguide (#26533)
Available as a normal synchronous module in tests
Available as an async import in core, or via the `loadFaker` helper in themes/plugins (which cannot use async import directly)
2024-04-05 16:57:17 +01:00

17 lines
503 B
JavaScript

import Route from "@ember/routing/route";
import { service } from "@ember/service";
import { allCategories } from "discourse/plugins/styleguide/discourse/lib/styleguide";
export default class Styleguide extends Route {
@service styleguide;
async model() {
await this.styleguide.ensureFakerLoaded(); // So that it can be used synchronously in styleguide components
return allCategories();
}
setupController(controller, categories) {
controller.set("categories", categories);
}
}