2
0
mirror of https://github.com/esiur/esiur-js.git synced 2026-04-03 21:48:21 +00:00

Instance.Link

This commit is contained in:
2022-08-13 04:00:26 +03:00
parent 1985363ad7
commit 2689bb7fd5
12 changed files with 1595 additions and 829 deletions

View File

@@ -51,15 +51,30 @@ export default class MemoryStore extends IStore
return new AsyncReply(null);
}
get(resource)
get(path)
{
return new AsyncReply(null);
if (path.startsWith("$"))
{
let id = parseInt(path.substring(1));
return new AsyncReply (this.resources.get(id));
}
else
{
for(let r of this.resources.values())
{
if (r.instance.name == path)
return new AsyncReply(r);
}
}
return new AsyncReply(null);
}
link(resource)
{
if (resource.instance.store == this)
return this.instance.name + "/" + resource.instance.id;
return this.instance.name + "/$" + resource.instance.id;
}
trigger(trigger)