5.3.9 • Published 8 months ago

@ember-data-mirror/adapter v5.3.9

Weekly downloads
-
License
MIT
Repository
github
Last release
8 months ago

Caution ⚠️ This is LEGACY documentation for a feature that is no longer encouraged to be used. If starting a new app or thinking of implementing a new adapter, consider writing a Handler instead to be used with the RequestManager

Installation

This package is currently installed when installing ember-data.

If installing @ember-data/ packages individually install using your javascript package manager of choice. For instance with pnpm

pnpm add @ember-data-mirror/adapter

Tagged Releases

  • NPM Canary Version
  • NPM Beta Version
  • NPM Stable Version
  • NPM LTS Version
  • NPM LTS 4.12 Version

🚀 Setup

If using ember-data no additional setup is necesssary.

Note When using ember-data the below configuration is handled for you automatically.

To use legacy adapters you will need to have installed and configured the LegacyNetworkHandler from @ember-data-mirror/legacy-compat

pnpm add @ember-data-mirror/legacy-compat
import Store, { CacheHandler } from '@ember-data-mirror/store';
import RequestManager from '@ember-data-mirror/request';
import { LegacyNetworkHandler } from '@ember-data-mirror/legacy-compat';

export default class extends Store {
  requestManager = new RequestManager();

  constructor(args) {
    super(args);
    this.requestManager.use([LegacyNetworkHandler]);
    this.requestManager.useCache(CacheHandler);
  }
}

Usage

To use as either a per-type or application adapter, export one of the implementations within the adapters/ directory of your app as appropriate.

For instance, to configure an application adapter to use JSON:API

app/adapters/application.ts

export { default } from '@ember-data-mirror/adapter/json-api';

By default adapters are resolved by looking for an adapter with the same name in the adapters folder as the type given to store.adapterFor(<type>), falling back to looking for an adapter named application.

Overriding Resolution

If you would like to avoid using resolver semantics and your application has only one or a few adapters, you may ovveride the adapterFor hook on the store.

import Store from '@ember-data-mirror/store';
import Adapter from '@ember-data-mirror/adapter/json-api';

class extends Store {
  #adapter = new Adapter();

  adapterFor() {
    return this.#adapter;
  }
}

For the full list of APIs available read the code documentation for @ember-data-mirror/adapter. You may also be interested in learning more about *Ember*Data's Adapter Interface.

5.4.0-beta.12

8 months ago

5.4.0-alpha.113

8 months ago

5.3.9

8 months ago

5.4.0-alpha.112

8 months ago

5.4.0-alpha.111

8 months ago

5.4.0-alpha.108

10 months ago

5.4.0-alpha.107

10 months ago

5.4.0-alpha.109

9 months ago

5.4.0-alpha.100

10 months ago

5.4.0-alpha.87

12 months ago

5.4.0-alpha.86

12 months ago

5.4.0-alpha.102

10 months ago

5.4.0-alpha.85

1 year ago

5.4.0-alpha.101

10 months ago

5.4.0-alpha.84

1 year ago

5.4.0-alpha.104

10 months ago

5.4.0-alpha.83

1 year ago

5.4.0-alpha.103

10 months ago

5.4.0-alpha.82

1 year ago

5.4.0-alpha.106

10 months ago

5.4.0-alpha.81

1 year ago

5.4.0-alpha.105

10 months ago

5.4.0-alpha.80

1 year ago

5.4.0-beta.10

12 months ago

5.4.0-alpha.79

1 year ago

5.4.0-beta.11

12 months ago

5.4.0-alpha.78

1 year ago

5.4.0-alpha.77

1 year ago

5.4.0-alpha.90

12 months ago

5.4.0-alpha.98

11 months ago

5.4.0-alpha.110

8 months ago

5.4.0-alpha.97

11 months ago

5.4.0-alpha.94

11 months ago

5.4.0-alpha.93

11 months ago

5.4.0-alpha.92

11 months ago

5.4.0-alpha.91

12 months ago

5.4.0-alpha.89

12 months ago

5.4.0-alpha.88

12 months ago

5.4.0-alpha.99

10 months ago

5.4.0-alpha.76

1 year ago

5.4.0-alpha.75

1 year ago

5.4.0-alpha.74

1 year ago

5.4.0-alpha.73

1 year ago

5.4.0-alpha.72

1 year ago

5.4.0-alpha.71

1 year ago

5.4.0-alpha.70

1 year ago

5.4.0-beta.6

1 year ago

5.4.0-beta.7

1 year ago

5.4.0-beta.8

12 months ago

5.4.0-beta.9

12 months ago

5.3.8

12 months ago

5.3.7

12 months ago

5.3.6

12 months ago

5.3.5

12 months ago

5.3.4

1 year ago

5.4.0-beta.5

1 year ago

5.4.0-alpha.64

1 year ago

5.4.0-alpha.63

1 year ago

5.4.0-alpha.61

1 year ago

5.4.0-alpha.60

1 year ago

5.4.0-alpha.59

1 year ago

5.4.0-alpha.58

1 year ago

5.4.0-alpha.57

1 year ago

5.4.0-alpha.56

1 year ago

5.4.0-alpha.55

1 year ago

5.4.0-alpha.54

1 year ago

5.4.0-alpha.53

1 year ago

5.4.0-alpha.52

1 year ago

5.4.0-alpha.51

1 year ago

5.4.0-alpha.50

1 year ago

5.4.0-alpha.49

1 year ago