Skip to content

Commit 9050432

Browse files
committed
Avoid implicit injection _fastbootInfo deprecation pt 2
1 parent 8be7162 commit 9050432

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

packages/ember-cli-fastboot/addon/services/fastboot.js

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,19 @@ const FastBootService = Service.extend({
8989
return RequestObject.create({ request: get(this, '_fastbootInfo.request') });
9090
}),
9191

92-
_fastbootInfo: computed(function() {
93-
// this getter is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
94-
return getOwner(this).lookup('info:-fastboot');
92+
_fastbootInfo: computed({
93+
get() {
94+
if (this.__fastbootInfo) {
95+
return this.__fastbootInfo;
96+
}
97+
98+
// this getter is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
99+
return getOwner(this).lookup('info:-fastboot');
100+
},
101+
set(_key, value) {
102+
this.__fastbootInfo = value;
103+
return value;
104+
}
95105
}),
96106

97107
deferRendering(promise) {

0 commit comments

Comments
 (0)