GithubHelp home page GithubHelp logo

cobudget-old / ampersand-collection-lodash-mixin Goto Github PK

View Code? Open in Web Editor NEW

This project forked from strml/ampersand-collection-lodash-mixin

0.0 3.0 0.0 116 KB

A mixin for extending ampersand-collection with underscore methods.

License: MIT License

JavaScript 100.00%

ampersand-collection-lodash-mixin's Introduction

ampersand-collection-lodash-mixin

A mixin for extending ampersand-collection with lodash methods. This is a fork of ampersand-collection-underscore-mixin.

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 lodash methods, or better browser support, you can use this.

install

npm install ampersand-collection-lodash-mixin

example

var Collection = require('ampersand-collection');
var lodashMixin = require('ampersand-collection-lodash-mixin');


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

credits

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

Lodash is written by John-David Dalton.

If you like this follow @HenrikJoreteg on twitter.

license

MIT

ampersand-collection-lodash-mixin's People

Contributors

henrikjoreteg avatar strml avatar kamilogorek avatar latentflip avatar

Watchers

Jessy Kate Schingler avatar Mikey avatar James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.