js-data-adapter
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.1 • Public • Published
    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

    Install

    npm i js-data-adapter

    DownloadsWeekly Downloads

    1,815

    Version

    1.0.1

    License

    MIT

    Unpacked Size

    717 kB

    Total Files

    31

    Last publish

    Collaborators

    • coryrobinson42
    • jdobry