@live-change/dao
Advanced tools
Comparing version 0.2.9 to 0.2.10
@@ -26,3 +26,3 @@ const Observable = require("./Observable.js") | ||
this.fireObservers('set', list) | ||
for(var [object, property] of this.properties) { | ||
for(const [object, property] of this.properties) { | ||
object[property] = list | ||
@@ -129,3 +129,3 @@ } | ||
let jsonf = [] | ||
for(var k in fields) { | ||
for(const k in fields) { | ||
jsonf.push([k, JSON.stringify(fields[k])]) | ||
@@ -149,4 +149,4 @@ } | ||
unbindProperty(object, property) { | ||
for(var i = 0; i < this.properties.length; i++) { | ||
var prop = this.properties[i] | ||
for(let i = 0; i < this.properties.length; i++) { | ||
const prop = this.properties[i] | ||
if(prop[0] == object && prop[1] == property) { | ||
@@ -167,4 +167,4 @@ this.properties.splice(i,1) | ||
unbindErrorProperty(object, property) { | ||
for(var i = 0; i < this.errorProperties.length; i++) { | ||
var prop = this.errorProperties[i] | ||
for(let i = 0; i < this.errorProperties.length; i++) { | ||
const prop = this.errorProperties[i] | ||
if(prop[0] == object && prop[1] == property) { | ||
@@ -182,3 +182,3 @@ this.errorProperties.splice(i,1) | ||
let handled = super.handleError(error) | ||
for(var [object, property] of this.errorProperties) { | ||
for(const [object, property] of this.errorProperties) { | ||
handled = true | ||
@@ -185,0 +185,0 @@ object[property] = error |
@@ -58,3 +58,3 @@ const EventEmitter = require("./EventEmitter.js") | ||
if(!defn.generator) defn.generator = (value, what) => new ObservableList(value) | ||
defn.source = new RemoteDataSource(connection, defn.generator) | ||
defn.source = new RemoteDataSource(connection, defn) | ||
return defn | ||
@@ -61,0 +61,0 @@ break; |
class RemoteDataSource { | ||
constructor(connection, generator) { | ||
constructor(connection, definition) { | ||
this.definition = definition | ||
this.connection = connection | ||
this.generator = generator | ||
this.generator = definition.generator | ||
this.redirect = definition.redirect || (x=>x) | ||
} | ||
observable(what) { | ||
return this.connection.observable(what, this.generator) | ||
return this.connection.observable(this.redirect(what), this.generator) | ||
} | ||
get(what) { | ||
return this.connection.get(what) | ||
return this.connection.get(this.redirect(what)) | ||
} | ||
request(method, ...args) { | ||
return this.connection.request(method, ...args) | ||
return this.connection.request(this.redirect(method), ...args) | ||
} | ||
event(method, ...args) { | ||
return this.connection.event(method, ...args) | ||
return this.connection.event(this.redirect(method), ...args) | ||
} | ||
@@ -18,0 +20,0 @@ } |
@@ -39,3 +39,3 @@ { | ||
}, | ||
"version": "0.2.9" | ||
"version": "0.2.10" | ||
} |
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
129713
3721