2022-07-04 10:22:14 +00:00
|
|
|
import Component from '@glimmer/component';
|
|
|
|
import { tracked } from '@glimmer/tracking';
|
|
|
|
import { action } from '@ember/object';
|
2020-03-31 17:03:15 +00:00
|
|
|
import { inject as service } from '@ember/service';
|
|
|
|
|
2022-07-04 10:22:14 +00:00
|
|
|
export default class State extends Component {
|
|
|
|
@service('state') state;
|
|
|
|
|
|
|
|
@tracked render = false;
|
|
|
|
|
|
|
|
@action
|
|
|
|
attributeChanged([state, matches, notMatches]) {
|
|
|
|
if (typeof state === 'undefined') {
|
2020-03-31 17:03:15 +00:00
|
|
|
return;
|
|
|
|
}
|
2022-07-04 10:22:14 +00:00
|
|
|
this.render = typeof matches !== 'undefined' ?
|
|
|
|
this.state.matches(state, matches) :
|
|
|
|
!this.state.matches(state, notMatches);
|
|
|
|
}
|
|
|
|
}
|