Skip to content

Commit 46ad78a

Browse files
authored
Merge pull request #857 from snewcomer/sn/fix-implicit-injection-set
Avoid implicit injection _fastbootInfo deprecation pt 2
2 parents 8be7162 + a0ddbaa commit 46ad78a

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+
// this getter/setter pair is to avoid deprecation from [RFC - 680](https://github.com/emberjs/rfcs/pull/680)
93+
_fastbootInfo: computed({
94+
get() {
95+
if (this.__fastbootInfo) {
96+
return this.__fastbootInfo;
97+
}
98+
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)