mirror of
https://github.com/esiur/esiur-js.git
synced 2026-04-04 05:58:22 +00:00
SetSync
This commit is contained in:
@@ -170,14 +170,14 @@ export default class DistributedResource extends IResource
|
||||
|
||||
var makeSetter = function(index)
|
||||
{
|
||||
return function (value) {
|
||||
return async function (value) {
|
||||
if (self._p.destroyed)
|
||||
throw new Error("Trying to access a destroyed object.");
|
||||
|
||||
if (self._p.suspended)
|
||||
throw new Error("Trying to access a suspended object.");
|
||||
|
||||
self._set(index, value);
|
||||
await self._set(index, value);
|
||||
};
|
||||
};
|
||||
|
||||
@@ -295,6 +295,10 @@ export default class DistributedResource extends IResource
|
||||
if (index >= this._p.properties.length)
|
||||
return null;
|
||||
|
||||
// Awaiting null is not a problem in JS
|
||||
if (this._p.properties[index] == value)
|
||||
return null;
|
||||
|
||||
var reply = new AsyncReply();
|
||||
|
||||
var parameters = Codec.compose(value, this._p.connection);
|
||||
|
||||
Reference in New Issue
Block a user