Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ampersand-io-collection

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-io-collection - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

tests/backbone.js

20

ampersand-io-collection.js

@@ -6,6 +6,13 @@ /*$AMPERSAND_VERSION*/

var events = {
fetch: 'collection-fetch',
onFetch: 'collection-fetch-response',
onUpdate: 'on-model-update',
onNew: 'on-model-new'
};
function AmpersandIOCollection(attrs, options){
options || (options = {});
Base.call(this, attrs, options);
IOMixin.call(this, options.socket, options);
AmpersandIO.call(this, options.socket, options);
}

@@ -15,8 +22,3 @@

events: {
fetch: 'collection-fetch',
onFetch: 'on-collection-fetch',
onUpdate: 'on-model-update',
onNew: 'on-model-new'
},
events: events,

@@ -56,3 +58,3 @@ listeners: {

if (err){
this.trigger('error', this, response, options);
collection.trigger('error', this, response, options);
}

@@ -177,5 +179,5 @@ };

AmpersandIOCollection.prototype = Object.create(Base.prototype);
extend(AmpersandIOCollection.prototype, Object.create(IOMixin.prototype));
extend(AmpersandIOCollection.prototype, IOMixin.prototype);
AmpersandIOCollection.extend = Base.extend;
module.exports = AmpersandIOCollection;

@@ -32,3 +32,3 @@ var io = require('socket.io')();

console.log(data);
socket.emit('fetch-response', {test: 'test'}, function(){console.log('done');});
socket.emit('collection-fetch-response', {test: 'test'}, function(){console.log('done');});
cb();

@@ -45,3 +45,4 @@ });

}});
var mycollection = new ((AmpersandCollection.extend(new IOCollection())).extend({model: mymodel}))();
var mycollection = new (IOCollection.extend({model: mymodel}))({}, {socket: 'http://localhost:3000'});
console.log(mycollection);

@@ -48,0 +49,0 @@ mycollection.setListeners();

{
"name": "ampersand-io-collection",
"version": "0.1.4",
"version": "0.1.5",
"description": "ampersand collection mixin based on rest collection mixin to be used with socket.io",
"main": "ampersand-io-collection.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"test": "browserify tests | tape-run | tap-spec",
"lint": "node_modules/.bin/jshint -c .jshintrc ampersand-io-collection.js"

@@ -15,3 +15,3 @@ },

"type": "git",
"url": "https://github.com/JGAntunes/ampersand-io-collection"
"url": "https://github.com/sinfo/ampersand-io-collection"
},

@@ -27,21 +27,20 @@ "keywords": [

"bugs": {
"url": "https://github.com/JGAntunes/ampersand-io-collection/issues"
"url": "https://github.com/sinfo/ampersand-io-collection/issues"
},
"homepage": "https://github.com/JGAntunes/ampersand-io-collection",
"homepage": "https://github.com/sinfo/ampersand-io-collection",
"dependencies": {
"extend-object": "^1.0.0",
"ampersand-collection": "~1.3.17",
"ampersand-io": "^0.1.0"
"ampersand-collection": "^1.3.17",
"ampersand-io": "^0.4.2"
},
"devDependencies": {
"ampersand-collection": "^1.3.17",
"ampersand-io-model": "https://github.com/jgantunes/ampersand-io-model/tarball/master",
"browserify": "^7.0.1",
"jshint": "~2.5.10",
"pre-commit": "https://github.com/jgantunes/pre-commit/tarball/master",
"ampersand-io-model": "^0.3.0",
"browserify": "^9.0.3",
"jshint": "^2.6.3",
"pre-commit": "^1.0.6",
"socket.io": "^1.2.1",
"tap-spec": "^2.1.2",
"tape": "^3.0.3",
"tape-run": "^0.3.0"
"tape-run": "^1.0.0"
}
}

@@ -0,2 +1,23 @@

[![Build Status](https://travis-ci.org/sinfo/ampersand-io-collection.svg?branch=master)](https://travis-ci.org/sinfo/ampersand-io-collection)
[![Dependency Status](https://david-dm.org/sinfo/ampersand-io-collection.svg)](https://david-dm.org/sinfo/ampersand-io-collection)
[![devDependency Status](https://david-dm.org/sinfo/ampersand-io-collection/dev-status.svg)](https://david-dm.org/sinfo/ampersand-io-collection#info=devDependencies)
ampersand-io-collection
=============================
Still under development. Further documentation on the way.
Based on [ampersand-collection-rest-mixin](https://github.com/AmpersandJS/ampersand-collection-rest-mixin) to be used with [socket.io](http://socket.io).
ampersand-io-collection is not a mixin but an extension built on [ampersand-collection](http://ampersandjs.com/docs/#ampersand-collection) to provide methods and properties that you'll often want when modeling data and collections you get from an API, using a realtime based socket app.
See also the [ampersand-io](https://github.com/sinfo/ampersand-io) documentation for further info on the `socket.io` ampersand wrapper API this module uses.
## Installing
npm install ampersand-io-collection
```
## License
MIT

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc