ember-cli-array-slice

2.0.0 • Public • Published

ember-cli-array-slice

master branch build status

Ember CLI array slice addon.

ember-cli-array-slice exposes an Ember ArrayProxy subclass which proxies a slice of a given content array. Its values will update when the original array is modified.

Example

import ArraySlice from 'array-slice';
 
var sliced = ArraySlice.create({
    content: [3, 1, 4, 1, 5, 9],
    offset: 2,
    limit: 3
});
 
console.log(sliced.toArray()); // [4, 1, 5];

Properties

content: Ember.Array (optional, default = [])

The content array. Must be an object that implements Ember.Array and/or Ember.MutableArray. See Ember.ArrayProxy#content.

offset: Number (optional, default = 0)

Index where slice begins.

limit: Number (optional, default = Infinity)

Maximum number of elements to hold in the array. By default, holds all elements after offset.

Installing

With npm:

$ npm install --save ember-cli-array-slice

Or with Ember CLI:

$ ember install:npm ember-cli-array-slice

License

MIT license.

Package Sidebar

Install

npm i ember-cli-array-slice

Weekly Downloads

1

Version

2.0.0

License

MIT

Last publish

Collaborators

  • j-