Socket
Book a DemoInstallSign in
Socket

ember-gather

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ember-gather

A handy pair of macros for computing flattened arrays

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

ember-gather

A handy pair of macros for computing flattened arrays.

Latest NPM release CircleCI Build Status Code Climate Ember Observer Score Dependencies Dev Dependencies License

Usage

Use gather when you just need to flatten the top-level value of each property into a list:

import { gather } from 'ember-gather';
import Component from 'ember-component';

export default Component.extend({
  terrestrials: ['Mercury', 'Venus', 'Earth', 'Mars'],
  gasGiants: ['Jupiter', 'Saturn', 'Neptune', 'Uranus'],

  planets: gather('terrestrials', 'gasGiants')  // => ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Neptune', 'Uranus']
});

Use deepGather when you need to flatten all items within all values of each property into a list:

import { deepGather } from 'ember-gather';
import Component from 'ember-component';

const planets = [
  ['Mercury', 'Venus', 'Earth', 'Mars'],
  ['Jupiter', 'Saturn', 'Neptune', 'Uranus']
];

const dwarfPlanets = ['Pluto', 'Ceres', 'Eris', 'Haumes', 'MakeMake'];

export default Component.extend({
  planets,
  dwarfPlanets,

  planetaryBodies: deepGather('planets', 'dwarfPlanets') // => ['Mercury', 'Venus', 'Earth', 'Mars', 'Jupiter', 'Saturn', 'Neptune', 'Uranus', 'Pluto', 'Ceres', 'Eris', 'Haumes', 'MakeMake']
});

Developing

  • git clone <repository-url> this repository
  • cd ember-gather
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:each to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://ember-cli.com/.

Keywords

ember-addon

FAQs

Package last updated on 06 Oct 2016

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