Socket
Socket
Sign inDemoInstall

ampersand-collection-underscore-mixin

Package Overview
Dependencies
10
Maintainers
3
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    ampersand-collection-underscore-mixin

A mixin for extending ampersand-collection with underscore methods.


Version published
Weekly downloads
146
increased by53.68%
Maintainers
3
Install size
763 kB
Created
Weekly downloads
 

Readme

Source

ampersand-collection-underscore-mixin

A mixin for extending ampersand-collection with underscore methods.

Deprecation Notice

As of v4.0.0 this is no longer mixed in to ampersand-rest-collection. Instead it uses ampersand-collection-lodash-mixin to match all other core module's move to using lodash. We no longer recommend using this module individually, and if you are we recommend converting to the lodash mixin.

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

Last updated on 07 Apr 2015

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc