get method

AsyncReply<IResource?> get(
  1. String path
)
override
Get a resource by its path. Path to the resource.

Implementation

AsyncReply<IResource?> get(String path) {
  var rt = new AsyncReply<IResource?>();

  query(path)
    ..then((ar) {
      if (ar.length > 0)
        rt.trigger(ar[0]);
      else
        rt.trigger(null);
    })
    ..error((ex) => rt.triggerError(ex));

  return rt;
}