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

ampersand-collection-underscore-mixin

Package Overview
Dependencies
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ampersand-collection-underscore-mixin

A mixin for extending ampersand-collection with underscore methods.

  • 1.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
56
increased by75%
Maintainers
3
Weekly downloads
 
Created
Source

ampersand-collection-underscore-mixin

A mixin for extending ampersand-collection with underscore methods.

If you're using an ampersand-rest-collection this is already mixed in for you.

Out of the box, ampersand-collections proxy the ES5 iteration methods already so you don't have to use this mixin, but if you want all the underscore methods, or better browser support, you can use this.

install

npm install ampersand-collection-underscore-mixin

example

var Collection = require('ampersand-collection');
var underscoreMixin = require('ampersand-collection-underscore-mixin');


module.exports = Collection.extend(underscoreMixin, {
    sampleMethod: function () {
        // now we've got underscore methods 
        // we can call that are applied to models
        // in the collection.
        this.filter( ... );
        this.some( ... );
        this.each( ... )
    }
});

credits

All credit for underscore and this approach in backbone goes to Jeremy Ashkenas and the rest of the Backbone and Underscore authors.

If you like this follow @HenrikJoreteg on twitter.

license

MIT

Keywords

FAQs

Package last updated on 04 Sep 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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