How to use the @ember-data/adapter.extend function in @ember-data/adapter

To help you get started, we’ve selected a few @ember-data/adapter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github emberjs / data / packages / adapter / addon / rest.js View on Github external
export default RESTAdapter.extend({
    headers: computed(function() {
      return {
        'API_KEY': get(document.cookie.match(/apiKey\=([^;]*)/), '1'),
        'ANOTHER_HEADER': 'Some header value'
      };
    }).volatile()
  });

@class RESTAdapter @constructor @extends Adapter @uses BuildURLMixin */ const RESTAdapter = Adapter.extend(BuildURLMixin, { defaultSerializer: '-rest',

_defaultContentType: 'application/json; charset=utf-8',

fastboot: computed({ // Avoid computed property override deprecation in fastboot as suggested by: // https://deprecations.emberjs.com/v3.x/#toc_computed-property-override get() { if (this._fastboot) { return this._fastboot; } return (this._fastboot = getOwner(this).lookup('service:fastboot')); }, set(key, value) { return (this._fastboot = value); },