Skip to content

Commit da4b59b

Browse files
committed
refactor to avoid needing global "inc" helper
1 parent 84fb6c7 commit da4b59b

File tree

5 files changed

+5
-28
lines changed

5 files changed

+5
-28
lines changed

addon/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@
7272
"./components/json-viewer.js": "./dist/_app_/components/json-viewer.js",
7373
"./components/simple-value.js": "./dist/_app_/components/simple-value.js",
7474
"./components/value-viewer.js": "./dist/_app_/components/value-viewer.js",
75-
"./helpers/inc.js": "./dist/_app_/helpers/inc.js",
7675
"./helpers/is-last.js": "./dist/_app_/helpers/is-last.js"
7776
}
7877
},

addon/src/components/entry-viewer.hbs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
<ValueViewer
2727
@value={{@value}}
2828
@showSummary={{this.isNotExpanded}}
29-
@depth={{inc @depth}}
29+
@depth={{this.incrementedDepth}}
3030
@displayOptions={{@displayOptions}}
3131
@path={{@path}}
3232
/>

addon/src/components/entry-viewer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ export default class EntryViewer extends Component {
4646
return !isPrimitive(this.args.value);
4747
}
4848

49+
get incrementedDepth() {
50+
return this.args.depth + 1;
51+
}
52+
4953
@action
5054
toggleExpanded() {
5155
if (!this.isToggleable) {

addon/src/helpers/inc.js

Lines changed: 0 additions & 10 deletions
This file was deleted.

test-app/tests/integration/helpers/inc-test.js

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)