From 30514b974eafe230b143ddbef5bd52fe641b889e Mon Sep 17 00:00:00 2001 From: bmac Date: Sun, 7 Jan 2018 17:32:10 -0500 Subject: [PATCH] [doc beta] Use Ember.computed in the headers examples to avoid ember eslint warning --- addon/adapters/rest.js | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/addon/adapters/rest.js b/addon/adapters/rest.js index abf5b847218..a1d6400ed86 100644 --- a/addon/adapters/rest.js +++ b/addon/adapters/rest.js @@ -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' + }; } }); ``` @@ -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' + }; + }) }); ```