AmpFire-Collection
A modified, CommonJS version of Firebase's BackboneFire for AmpersandJS Collections.
Installation
npm install ampfire-collection
If you want it automatically added to your project's package.json use:
npm install ampfire-collection --save
Info
- It supports the ampersand-rest-collection module.
- The ampersand-collection with the ampersand-collection-rest-mixin can be used if the lodash functions aren't needed.
Basic Usage
First you should require the module as well as the ampersand-model module for creating our collection's model instances.
var AmpfireCollection = ;var Model = ;
Then you can create an ampersand-model to pass to your collection
var ExampleModel = Model;
Next simply extend the AmpfireCollection passing it our newly created ExampleModel and the firebase url
var RealtimeCollection = AmpfireCollection; // Instantiate the collection var realtimeCollection = ; realtimeCollection;
The rest of the API is the same as that of BackboneFire
Dependencies
- ampersand-rest-collection module
- lodash functions
- extend: lodash.object
- keys: lodash.object
- has: lodash.object
- isObject: lodash.lang
- isFunction: lodash.lang
- isArray: lodash.lang
- clone: lodash.lang
- bind: lodash.function
- defer: lodash.function
- each: lodash.collection
- find: lodash.collection,
- difference: lodash.array
- union: lodash.array
Tests
Coming soon...
Demo
Coming soon...
Credits
This is all just a modification of the amazing work the Firebase team did on BackboneFire. It uses the awesome AmpersandJS Framework from the guys over at &yet.
Licence
MIT