1
- /* eslint-disable ember/no-computed-properties-in-native-classes, ember/classic-decorator-hooks */
2
1
import {
3
2
classNames ,
4
3
attributeBindings ,
5
4
tagName ,
6
5
} from '@ember-decorators/component' ;
7
- import { set , get , computed } from '@ember/object' ;
6
+ import { get } from '@ember/object' ;
8
7
import Component from '@ember/component' ;
9
8
import { A } from '@ember/array' ;
10
9
@@ -17,11 +16,6 @@ export default class Dropdown extends Component {
17
16
18
17
isVisible = false ;
19
18
20
- init ( ) {
21
- super . init ( ...arguments ) ;
22
- set ( this , 'results' , A ( ) ) ;
23
- }
24
-
25
19
// show
26
20
// Massage data to make it easier for displaying on the template
27
21
// Returned object:
@@ -32,13 +26,14 @@ export default class Dropdown extends Component {
32
26
* }
33
27
* }
34
28
*/
35
- @ computed ( 'results.[]' )
29
+
36
30
get _groupedResults ( ) {
37
- if ( ! get ( this , 'results.length' ) ) {
31
+ let results = get ( this , 'results' ) ;
32
+ if ( ! results . length ) {
38
33
return { } ;
39
34
}
40
35
41
- const lvl0Group = this . results . reduce ( ( previous , current ) => {
36
+ const lvl0Group = results . reduce ( ( previous , current ) => {
42
37
// Remap all lowercase usages of 'guides' to 'Guides'
43
38
let lvl0 = get ( current , 'hierarchy.lvl0' ) ;
44
39
// If lvl0 doesn't exist in the resulting object, create the array
0 commit comments