ember-cli-array-pauser
v3.0.0
Published
Pause and resume an array
Downloads
4
Readme
ember-cli-array-pauser
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