ember-cli-array-pauser

3.0.0 • Public • Published

ember-cli-array-pauser

master branch build status

Ember CLI array pauser addon.

ember-cli-array-pauser exposes an Ember ArrayProxy subclass which can be paused and resumed.

Example

import Ember from 'ember';
import ArrayPauser from 'array-pauser';
 
var arr = Ember.A(['original']);
var stream = ArrayPauser.create({
    content: arr
});
 
arr.pushObject('to remove');
arr.pushObject('to change');
console.log(stream.toArray()); // ['original', 'to remove', 'to change']
stream.set('isPaused', true);
arr.replace(2, 'changed');
arr.pushObject('new item');
arr.removeObject('to remove');
console.log(stream.toArray()); // ['original', 'to remove', 'to change']
stream.set('isPaused', false);
console.log(stream.toArray()); // ['original', 'changed', 'new item']

Properties

content: Ember.Array (optional, default = null)

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

isPaused: Boolean (optional, default = false)

This value determines the pause state of this array proxy.

Installing

With npm:

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

Or with Ember CLI:

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

License

MIT license.

Readme

Keywords

Package Sidebar

Install

npm i ember-cli-array-pauser

Weekly Downloads

9

Version

3.0.0

License

MIT

Last publish

Collaborators

  • binaryluke
  • j-