A collection library extending ampersand-collection with REST API and Lodash utility mixins. Version 6.0.0 is current stable. It provides a Backbone.Collection-like interface for RESTful operations (fetch, create, update, delete) and includes Lodash methods for collection manipulation. Part of the Ampersand.js toolkit for building client-side apps. Differentiates from Backbone by being more modular and emphasizing simplicity.
npm install ampersand-rest-collectionNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates creating a custom collection with a model and URL, then fetching data from the server.
If you need IE8 support, stick with version 5.x.
Define ajaxConfig as a function that returns an object, e.g., ajaxConfig: function() { return { headers: { ... } }; }Pass { dataType: 'json' } in fetch options, or ensure your server returns correct Content-Type header.Call fetch in componentDidMount or equivalent lifecycle method, not in the constructor.
Use: const Collection = require('ampersand-rest-collection'); then Collection.extend({...})Configure your server to include Access-Control-Allow-Origin header, or set up a proxy. For IE9, use ajaxConfig: { useXDR: true }.Ensure you are using ampersand-rest-collection, not plain ampersand-collection. Check your require/import path.