ampersand-collection
Advanced tools
Comparing version 0.2.2 to 0.2.3
{ | ||
"name": "ampersand-collection", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -5,0 +5,0 @@ "bugs": { |
@@ -9,4 +9,22 @@ # ampersand-collection | ||
<!-- starthide --> | ||
Part of the [Ampersand.js toolkit](http://ampersandjs.com) for building clientside applications. | ||
<!-- endhide --> | ||
## install | ||
``` | ||
npm i ampersand-collection | ||
``` | ||
## massive flexibility | ||
The collection is a fairly low-level tool, in that it's useful for any time you want to be able to store JS objects in an array. | ||
In many ways it's simply an observable array of objects. | ||
It emits `add`, `remove` events and makes it possible to merge in a set of objects into an existing collection and emit change events appropriately. | ||
If you extend it with a `.model` property that contains a constructor, the collection will ensure that objects that don't match that constructor are instantiated before being added to the collection. | ||
For example: | ||
@@ -44,3 +62,14 @@ | ||
``` | ||
<!-- starthide --> | ||
``` | ||
## credits | ||
Created by [@HenrikJoreteg](http://twitter.com/henrikjoreteg) but many ideas and some code (especially for the `set`) methods should be credited to Jeremy Ashkenas and the rest of the Backbone.js authors. | ||
## license | ||
MIT | ||
<!-- endhide --> |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
15277
74