mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
8cc4c6c4a1
no issue - since `ember-concurrency@2.0` it's possible to use the standard imports as decorators removing the need for the extra `ember-concurrency-decorators` dependency and imports
23 lines
578 B
JavaScript
23 lines
578 B
JavaScript
import Component from '@glimmer/component';
|
|
import {task, timeout} from 'ember-concurrency';
|
|
import {tracked} from '@glimmer/tracking';
|
|
|
|
export default class GhLoadingSpinnerComponent extends Component {
|
|
@tracked showSpinner = false;
|
|
|
|
// ms until the loader is displayed,
|
|
// prevents unnecessary flash of spinner
|
|
slowLoadTimeout = 200;
|
|
|
|
constructor() {
|
|
super(...arguments);
|
|
this.startSpinnerTimeout.perform();
|
|
}
|
|
|
|
@task
|
|
*startSpinnerTimeout() {
|
|
yield timeout(this.slowLoadTimeout);
|
|
this.showSpinner = true;
|
|
}
|
|
}
|