Skip to content

Commit

Permalink
Merge pull request #5318 from bmac/computed-headers
Browse files Browse the repository at this point in the history
Use Ember.computed in the headers examples to avoid ember eslint warning
  • Loading branch information
fivetanley authored Jan 22, 2018
2 parents 7d0174e + 30514b9 commit 6894000
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions addon/adapters/rest.js
Original file line number Diff line number Diff line change
Expand Up @@ -233,11 +233,14 @@ const Promise = EmberPromise;
```app/adapters/application.js
import DS from 'ember-data';
import { computed } from '@ember/object';
export default DS.RESTAdapter.extend({
headers: {
'API_KEY': 'secret key',
'ANOTHER_HEADER': 'Some header value'
headers: computed(function() {
return {
'API_KEY': 'secret key',
'ANOTHER_HEADER': 'Some header value'
};
}
});
```
Expand Down Expand Up @@ -441,12 +444,15 @@ const RESTAdapter = Adapter.extend(BuildURLMixin, {
```app/adapters/application.js
import DS from 'ember-data';
import { computed } from '@ember/object';
export default DS.RESTAdapter.extend({
headers: {
'API_KEY': 'secret key',
'ANOTHER_HEADER': 'Some header value'
}
headers: computed(function() {
return {
'API_KEY': 'secret key',
'ANOTHER_HEADER': 'Some header value'
};
})
});
```
Expand Down

0 comments on commit 6894000

Please sign in to comment.