2
0
mirror of https://github.com/esiur/esiur-js.git synced 2025-05-06 12:32:58 +00:00

Esiur 1.2.4

This commit is contained in:
Ahmed Zamil 2019-07-16 03:20:10 +03:00
parent de5f2cbdd2
commit 3ac2eccf0f
7 changed files with 19 additions and 7 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
node_modules/ src/node_modules/
test.js test.js

View File

@ -2,7 +2,6 @@ exports.printMsg = function() {
console.log("Esiur 1.1"); console.log("Esiur 1.1");
} }
module.exports = { Warehouse, DistributedConnection}; module.exports = { wh };
let WebSocket = require('ws') let WebSocket = require('ws')

View File

@ -183,10 +183,18 @@ export default class DistributedResource extends IResource
var pt = this.instance.template.getPropertyTemplateByIndex(index); var pt = this.instance.template.getPropertyTemplateByIndex(index);
this._p.properties[index] = value; this._p.properties[index] = value;
this.instance.emitModification(pt, value); this.instance.emitModification(pt, value);
// this to invoke other property setters
this._p.neglect = true;
this[pt.name] = null;
this._p.neglect = false;
} }
_set(index, value) _set(index, value)
{ {
if (this._p.neglect)
return;
if (index >= this._p.properties.length) if (index >= this._p.properties.length)
return null; return null;

View File

@ -116,7 +116,7 @@ export class WH extends IEventHandler
{ {
var store = this.new(handler, url[0] + "://" + hostname); var store = this.new(handler, url[0] + "://" + hostname);
store.open(settings).then(x=>{ store.open(settings).then(x=>{
if (pathname.length > 0 && pathname[1] != "") if (pathname.length > 0 && pathname != "")
store.get(pathname).then(r=>{ store.get(pathname).then(r=>{
rt.trigger(r); rt.trigger(r);
}).error(e => rt.triggerError(e)); }).error(e => rt.triggerError(e));

View File

@ -1,2 +1,7 @@
import wh from './Resource/Warehouse.js'; import wh from './Resource/Warehouse.js';
export default wh;
if (window)
window.wh = wh;
export default wh;

View File

@ -1,8 +1,8 @@
{ {
"name": "esiur", "name": "esiur",
"version": "1.2.3", "version": "1.2.4",
"description": "Distributed Object Framework", "description": "Distributed Object Framework",
"main": "build/esiur-debug-node.js", "main": "esiur.js",
"scripts": { "scripts": {
"test": "echo \"Error: no test specified\" && exit 1" "test": "echo \"Error: no test specified\" && exit 1"
}, },