@@ -124,12 +124,12 @@ class WaitForPropertyYieldable extends EmberYieldable {
124
124
*
125
125
* ```js
126
126
* import { task, waitForQueue } from 'ember-concurrency';
127
- * export default Component.extend( {
128
- * myTask: task(function * () {
127
+ * export default class MyComponent extends Component {
128
+ * @ task *myTask () {
129
129
* yield waitForQueue('afterRender');
130
130
* console.log("now we're in the afterRender queue");
131
- * })
132
- * });
131
+ * }
132
+ * }
133
133
* ```
134
134
*
135
135
* @param {string } queueName the name of the Ember run loop queue
@@ -145,8 +145,8 @@ export function waitForQueue(queueName) {
145
145
*
146
146
* ```js
147
147
* import { task, waitForEvent } from 'ember-concurrency';
148
- * export default Component.extend( {
149
- * myTask: task(function * () {
148
+ * export default class MyComponent extends Component {
149
+ * @ task *myTask () {
150
150
* console.log("Please click anywhere..");
151
151
* let clickEvent = yield waitForEvent($('body'), 'click');
152
152
* console.log("Got event", clickEvent);
@@ -155,8 +155,8 @@ export function waitForQueue(queueName) {
155
155
* console.log("Got foo event", emberEvent);
156
156
*
157
157
* // somewhere else: component.trigger('foo', { value: 123 });
158
- * })
159
- * });
158
+ * }
159
+ * }
160
160
* ```
161
161
*
162
162
* @param {object } object the Ember Object, jQuery element, or other object with .on() and .off() APIs
@@ -187,24 +187,24 @@ export function waitForEvent(object, eventName) {
187
187
*
188
188
* ```js
189
189
* import { task, waitForProperty } from 'ember-concurrency';
190
- * export default Component.extend( {
191
- * foo: 0,
190
+ * export default class MyComponent extends Component {
191
+ * @tracked foo = 0;
192
192
*
193
- * myTask: task(function * () {
193
+ * @ task *myTask () {
194
194
* console.log("Waiting for `foo` to become 5");
195
195
*
196
196
* yield waitForProperty(this, 'foo', v => v === 5);
197
197
* // alternatively: yield waitForProperty(this, 'foo', 5);
198
198
*
199
- * // somewhere else: this.set(' foo', 5)
199
+ * // somewhere else: this.foo = 5;
200
200
*
201
201
* console.log("`foo` is 5!");
202
202
*
203
203
* // wait for another task to be idle before running:
204
204
* yield waitForProperty(this, 'otherTask.isIdle');
205
205
* console.log("otherTask is idle!");
206
- * })
207
- * });
206
+ * }
207
+ * }
208
208
* ```
209
209
*
210
210
* @param {object } object an object (most likely an Ember Object)
0 commit comments