-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* replace .set() with @Tracked * fix missing tracked * consolidate changelog * conslidate again * add missing tracked
- Loading branch information
Showing
18 changed files
with
78 additions
and
391 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
7 changes: 4 additions & 3 deletions
7
packages/test-app/app/components/task-function-syntax-3/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
import Component from '@ember/component'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { task, timeout } from 'ember-concurrency'; | ||
|
||
export default class TaskFunctionSyntaxComponent3 extends Component { | ||
tagName = ''; | ||
status = null; | ||
@tracked status = null; | ||
|
||
// BEGIN-SNIPPET task-function-syntax-3 | ||
myTask = task(async () => { | ||
this.set('status', `Thinking...`); | ||
this.status = `Thinking...`; | ||
let promise = timeout(1000).then(() => 123); | ||
let resolvedValue = await promise; | ||
this.set('status', `The value is ${resolvedValue}`); | ||
this.status = `The value is ${resolvedValue}`; | ||
}); | ||
// END-SNIPPET | ||
} |
9 changes: 5 additions & 4 deletions
9
packages/test-app/app/components/task-function-syntax-4/component.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 0 additions & 25 deletions
25
packages/test-app/app/components/task-function-syntax-5/component.js
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,21 @@ | ||
import Controller from '@ember/controller'; | ||
import { action } from '@ember/object'; | ||
import { tracked } from '@glimmer/tracking'; | ||
import { task, timeout } from 'ember-concurrency'; | ||
|
||
export default class FooController extends Controller { | ||
isShowingButton = false; | ||
@tracked isShowingButton = false; | ||
|
||
showButtonSoon = task(async () => { | ||
this.set('isShowingButton', false); | ||
this.isShowingButton = false; | ||
await timeout(200); | ||
this.set('isShowingButton', true); | ||
this.isShowingButton = true; | ||
}); | ||
|
||
value = 0; | ||
|
||
@action | ||
setValue() { | ||
this.set('value', 123); | ||
this.value = 123; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.