flight-withEach

A simple Flight mixin that enriches components with underscore.js _.each function


License
MIT
Install
bower install flight-withEach

Documentation

flight-withEach

Build Status

A Flight mixin that enriches components with underscore.js _.each function.

Installation

bower install --save flight-withEach

Example

define(function(require) {
    
  var defineComponent = require('flight/lib/component');
  var withDialog      = require('bower_components/flight-withEach/lib/withEach');

  return defineComponent(fancyComponent, withEach);

  function fancyComponent() {
    
    // Logs each number in turn
    this.each([1, 2, 3], function(value, i) {
        console.log(value);
    });
    
    // Logs each number in turn
    this.each({one: 1, two: 2, three: 3}, function(value, i){
        console.log(value);
    });
    
  }
  
});

Development

Development of this component requires Bower, and preferably Karma to be globally installed:

npm install -g bower karma

Then install the Node.js and client-side dependencies by running the following commands in the repo's root directory.

npm install
bower install

To continuously run the tests in Chrome and Firefox during development, just run:

karma start

Contributing to this project

Anyone and everyone is welcome to contribute. Please take a moment to review the guidelines for contributing.