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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user