Skip to content

Base adapter class that all other js-data adapters extend.

License

Notifications You must be signed in to change notification settings

js-data/js-data-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 29, 2018
59f0479 · Oct 29, 2018

History

45 Commits
Apr 28, 2016
May 13, 2016
Jul 2, 2017
Jul 2, 2017
Jul 2, 2017
Oct 29, 2018
Aug 11, 2016
Jul 2, 2017
Jul 2, 2017
Jul 2, 2017
Jul 8, 2016
Jul 8, 2016
Jul 2, 2017
Nov 8, 2016
Oct 29, 2018
Oct 29, 2018
Jul 2, 2017
Jul 2, 2017
Apr 30, 2016
Jul 2, 2017

Repository files navigation

js-data logo

js-data-adapter

Slack Status npm version npm downloads build coverage

Base adapter class that all other JSData adapters extend.

Refer to the various JSData adapter repositories to see how they extend Adapter.

Usage

Browser-based adapter
npm i --save js-data js-data-adapter
Node.js based adapter
npm i --save js-data js-data-adapter

Now extend the adapter:

import {Adapter} from 'js-data-adapter'
// ES6
class MyAdapter extends Adapter {}
var Adapter = require('js-data-adapter').Adapter
// Use Adapter.extend
var MyAdapter = Adapter.extend()
var Adapter = require('js-data-adapter').Adapter

// Manually extend
function MyAdapter (opts) {
  Adapter.call(this, opts)
}

// Setup prototype inheritance from Adapter
MyAdapter.prototype = Object.create(Adapter.prototype, {
  constructor: {
    value: MyAdapter,
    enumerable: false,
    writable: true,
    configurable: true
  }
})

Object.defineProperty(MyAdapter, '__super__', {
  configurable: true,
  value: Adapter
})

Links

License

The MIT License (MIT)

Copyright (c) 2016 js-data-adapter project authors

About

Base adapter class that all other js-data adapters extend.

Resources

License

Stars

Watchers

Forks

Packages

No packages published