observ-array
Advanced tools
Comparing version 1.0.2 to 1.0.3
module.exports = addListener | ||
function addListener(observArray, observ) { | ||
var list = observArray.list | ||
var list = observArray._list | ||
@@ -6,0 +6,0 @@ return observ(function (value) { |
@@ -13,3 +13,3 @@ var ObservArray = require("./index.js") | ||
return [name, function () { | ||
var res = this.list[name].apply(this.list, arguments) | ||
var res = this._list[name].apply(this._list, arguments) | ||
@@ -44,9 +44,9 @@ if (res && Array.isArray(res)) { | ||
var args = slice.call(arguments) | ||
args.unshift(this.list.length, 0) | ||
args.unshift(this._list.length, 0) | ||
this.splice.apply(this, args) | ||
return this.list.length | ||
return this._list.length | ||
} | ||
function observArrayPop() { | ||
return this.splice(this.list.length - 1, 1)[0] | ||
return this.splice(this._list.length - 1, 1)[0] | ||
} | ||
@@ -61,3 +61,3 @@ function observArrayShift() { | ||
return this.list.length | ||
return this._list.length | ||
} | ||
@@ -64,0 +64,0 @@ |
@@ -50,3 +50,3 @@ var Observ = require("observ") | ||
// this is the list of observs instances | ||
obs.list = list | ||
obs._list = list | ||
@@ -62,3 +62,3 @@ var removeListeners = list.map(function (observ) { | ||
// listeners. Which causes rage bugs | ||
obs.removeListeners = removeListeners | ||
obs._removeListeners = removeListeners | ||
@@ -69,7 +69,7 @@ return ArrayMethods(obs, list) | ||
function get(index) { | ||
return this.list[index] | ||
return this._list[index] | ||
} | ||
function getLength() { | ||
return this.list.length | ||
return this._list.length | ||
} |
{ | ||
"name": "observ-array", | ||
"version": "1.0.2", | ||
"version": "1.0.3", | ||
"description": "An array containing observable values", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
@@ -16,3 +16,3 @@ var slice = Array.prototype.slice | ||
// generate a list of args to mutate the internal | ||
// list of only values | ||
// list of only obs | ||
var valueArgs = args.map(function (value, index) { | ||
@@ -29,3 +29,3 @@ if (index === 0 || index === 1) { | ||
// we remove the observs that we remove | ||
var removed = obs.list.splice.apply(obs.list, args) | ||
var removed = obs._list.splice.apply(obs._list, args) | ||
@@ -38,4 +38,4 @@ var extraRemoveListeners = args.slice(2).map(function (observ) { | ||
extraRemoveListeners.unshift(args[0], args[1]) | ||
var removedListeners = obs.removeListeners.splice | ||
.apply(obs.removeListeners, extraRemoveListeners) | ||
var removedListeners = obs._removeListeners.splice | ||
.apply(obs._removeListeners, extraRemoveListeners) | ||
@@ -42,0 +42,0 @@ removedListeners.forEach(function (removeObservListener) { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16958