From f8812ee1d756d71cb2f3194ff7ec458dcdbd2d21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomek=20Nie=C5=BCurawski?= Date: Sat, 11 Jun 2022 09:21:50 +0200 Subject: [PATCH] Application class: convert docs to ES6 syntax --- .../@ember/application/lib/application.ts | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/@ember/application/lib/application.ts b/packages/@ember/application/lib/application.ts index 8a332f6ffa7..7d42637ae18 100644 --- a/packages/@ember/application/lib/application.ts +++ b/packages/@ember/application/lib/application.ts @@ -43,11 +43,11 @@ import type { SimpleDocument, SimpleElement } from '@simple-dom/interface'; initialized. ```app/app.js - const App = Application.extend({ + export default class App extends Application { ready() { // your code here } - }) + } ``` Because `Application` ultimately inherits from `Ember.Namespace`, any classes @@ -84,12 +84,12 @@ import type { SimpleDocument, SimpleElement } from '@simple-dom/interface'; ```app/app.js import Application from '@ember/application'; - let App = Application.extend({ - customEvents: { + export default class App extends Application { + customEvents = { // add support for the paste event paste: 'paste' } - }); + } ``` To prevent Ember from setting up a listener for a default event, @@ -99,13 +99,13 @@ import type { SimpleDocument, SimpleElement } from '@simple-dom/interface'; ```app/app.js import Application from '@ember/application'; - let App = Application.extend({ - customEvents: { + export default class App extends Application { + customEvents = { // prevent listeners for mouseenter/mouseleave events mouseenter: null, mouseleave: null } - }); + } ``` By default, the application sets up these event listeners on the document @@ -119,9 +119,9 @@ import type { SimpleDocument, SimpleElement } from '@simple-dom/interface'; ```app/app.js import Application from '@ember/application'; - let App = Application.extend({ - rootElement: '#ember-app' - }); + export default class App extends Application { + rootElement = '#ember-app' + } ``` The `rootElement` can be either a DOM element or a CSS selector